]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
bootstrap: fix func_insert_if_absent bugs.
authorGary V. Vaughan <gary@gnu.org>
Sun, 27 Jan 2013 14:07:27 +0000 (21:07 +0700)
committerGary V. Vaughan <gary@gnu.org>
Sun, 27 Jan 2013 14:11:10 +0000 (21:11 +0700)
* 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 <gary@gnu.org>
THANKS
bootstrap
gl/build-aux/bootstrap.in

diff --git a/THANKS b/THANKS
index 92e6dff1205fb4475c0f1e50723ce932882488c3..7f3eb629518455072799ee1d62677f368aee8a61 100644 (file)
--- a/THANKS
+++ b/THANKS
   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
index 22972055baa815fb8a54fb0f0e0393f6cdf5e8bc..8232a4415ac4538ce1426629b85a3756fe22d5ce 100755 (executable)
--- 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
 }
index bfd4ad637b008ded4c3190a39ba49f5611ac013f..8af0c89cb11197d63f66dc3d43cce45516015313 100755 (executable)
@@ -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
 }