From: Gary V. Vaughan Date: Sun, 27 Jan 2013 14:07:27 +0000 (+0700) Subject: bootstrap: fix func_insert_if_absent bugs. X-Git-Tag: v2.4.2.418~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e40f7209a10b9d814f558784eb5018d5e404be3;p=thirdparty%2Flibtool.git bootstrap: fix func_insert_if_absent bugs. * gl/build-aux/bootstrap.in (func_insert_if_absent): Print verbose message when there is a new entry to add. Also, make sure to update the .gitignore file when changed. * bootstrap: Regenerate. * THANKS: Add Pádraig Brady. Reported by Pádraig Brady. Signed-off-by: Gary V. Vaughan --- diff --git a/THANKS b/THANKS index 92e6dff12..7f3eb6295 100644 --- a/THANKS +++ b/THANKS @@ -150,6 +150,7 @@ Nix nix@esperi.org.uk Olaf Lenz olenz@fias.uni-frankfurt.de Olly Betts olly@muscat.co.uk + Pádraig Brady P@draigBrady.com Patrice Fromy patrice.fromy@u-psud.fr Patrick Welche prlw1@newn.cam.ac.uk Paul Biggar paul.biggar@gmail.com diff --git a/bootstrap b/bootstrap index 22972055b..8232a4415 100755 --- a/bootstrap +++ b/bootstrap @@ -4380,14 +4380,14 @@ func_insert_if_absent () test -n "$duplicate_entries" \ && func_error "duplicate entries in $file: " $duplicate_entries - func_grep_q "$str" "$file" \ - && func_verbose "inserting '$str' into '$file'" + func_grep_q "^$str\$" "$file" \ + || func_verbose "inserting '$str' into '$file'" linesold=`func_gitignore_entries "$file" |wc -l` linesnew=`$bs_echo "$str" \ |func_gitignore_entries - "$file" |sort -u |wc -l` test "$linesold" -eq "$linesnew" \ - || sed "1i\\$nl$str$nl" "$file" \ + || { sed "1i\\$nl$str$nl" "$file" >"$file"T && mv "$file"T "$file"; } \ || func_permissions_error "$file" done } diff --git a/gl/build-aux/bootstrap.in b/gl/build-aux/bootstrap.in index bfd4ad637..8af0c89cb 100755 --- a/gl/build-aux/bootstrap.in +++ b/gl/build-aux/bootstrap.in @@ -2190,14 +2190,14 @@ func_insert_if_absent () test -n "$duplicate_entries" \ && func_error "duplicate entries in $file: " $duplicate_entries - func_grep_q "$str" "$file" \ - && func_verbose "inserting '$str' into '$file'" + func_grep_q "^$str\$" "$file" \ + || func_verbose "inserting '$str' into '$file'" linesold=`func_gitignore_entries "$file" |wc -l` linesnew=`$bs_echo "$str" \ |func_gitignore_entries - "$file" |sort -u |wc -l` test "$linesold" -eq "$linesnew" \ - || sed "1i\\$nl$str$nl" "$file" \ + || { sed "1i\\$nl$str$nl" "$file" >"$file"T && mv "$file"T "$file"; } \ || func_permissions_error "$file" done }