bootstrap: port to OpenBSD sed
authorMike Miller <mtmiller@ieee.org>
Tue, 13 Aug 2013 03:39:29 +0000 (23:39 -0400)
committerEric Blake <eblake@redhat.com>
Thu, 15 Aug 2013 22:52:39 +0000 (16:52 -0600)
* build-aux/bootstrap (insert_if_absent): Port to OpenBSD sed which
does not interpret `-' as a file argument to mean stdin.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
build-aux/bootstrap

index 9a3e2ff..9da8272 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-12  Mike Miller  <mtmiller@ieee.org>  (tiny change)
+
+       bootstrap: port to OpenBSD sed
+       * build-aux/bootstrap (insert_if_absent): Port to OpenBSD sed which
+       does not interpret `-' as a file argument to mean stdin.
+
 2013-08-15  Eric Blake  <eblake@redhat.com>
 
        warnings: minor optimization
index df763de..cc7fc1b 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2013-08-09.15; # UTC
+scriptversion=2013-08-15.22; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -320,7 +320,7 @@ insert_if_absent() {
     die "Error: Duplicate entries in $file: " $duplicate_entries
   fi
   linesold=$(gitignore_entries $file | wc -l)
-  linesnew=$(echo "$str" | gitignore_entries - $file | sort -u | wc -l)
+  linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
   if [ $linesold != $linesnew ] ; then
     { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
       || die "insert_if_absent $file $str: failed"