* srclist-update: Port to POSIX 1003.1-2001 hosts by avoiding the
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Jul 2003 23:33:45 +0000 (23:33 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Jul 2003 23:33:45 +0000 (23:33 +0000)
use of GNU extensions.  Change "x=`eval echo $x`" to the shorter
and sweeter "eval x=$x".

config/ChangeLog
config/srclist-update

index dbad7786a054b7c1f33336289071eb8c2dbe52d0..52c0a3d399e0522b0cf7f3b879f615f0cd4a337f 100644 (file)
@@ -1,3 +1,10 @@
+2003-07-08  Paul Eggert  <eggert@twinsun.com>
+
+       * srclist-update: Port to POSIX 1003.1-2001 hosts by avoiding the
+       use of GNU extensions.  Change "x=`eval echo $x`" to the shorter
+       and sweeter "eval x=$x".
+       * srclist.txt: Get lib/argp* from glibc.
+
 2003-07-06    <karl@gnu.org>
 
        * depcomp: update from automake.
index 74438f9dcc836292ef668749d5f50f4024ab41cb..cbe1af5292dcb78d340862cd83425bb1e2b4753b 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: srclist-update,v 1.5 2002-11-26 22:58:57 karl Exp $
+# $Id: srclist-update,v 1.6 2003-07-08 23:33:45 eggert Exp $
 #
 # Check for files in directory $1 being up to date, according to the
 # list on stdin.  Don't actually make any changes, just show the diffs.
@@ -51,22 +51,24 @@ fixlicense() \
 #
 fixfile() \
 {
-  if echo "$options" | grep -w gpl >/dev/null; then
-    fixlicense $1
-  else
-    cat $1
-  fi \
-  | fgrep -v '$'"Id:" >$2
+  case " $options " in
+  *' gpl '*)
+    fixlicense $1;;
+  *)
+    cat $1;;
+  esac \
+  | grep -v '\$Id: srclist-update,v 1.6 2003-07-08 23:33:45 eggert Exp $' >$2
 }
 
 
 # \f
 cat | while read src dst options; do
-  test -z "$dst" && continue  # skip lines without second element
-  echo "$src $dst" | sed 's/#.*$//' | egrep '^\s*$' >/dev/null \
-  && continue  # skip whitespace and comment-only lines
+  case $src:$dst in
+    *: ) continue;;  # skip lines without second element
+    '#'* ) continue;;  # skip comment-only lines
+  esac
 
-  src=`eval echo $src`
+  eval src=$src
   if test ! -r $src; then
     echo "$0: cannot read $src" >&2
     continue
@@ -75,7 +77,7 @@ cat | while read src dst options; do
   # Ignore subdirs in src dir.  E.g., if input spec is
   #   src/subdir/foo.c dst
   # write destination file dst/foo.c.
-  dst=`eval echo $dst`
+  eval dst=$dst
   test -d $dst && dst=$dst/`basename $src`
 
   # Make changes for sake of comparison.
@@ -94,7 +96,7 @@ cat | while read src dst options; do
     $verbose && echo "## $gplsrc $dst  # unchanged"
   else
     echo "## $gplsrc $dst  # changes"
-    diff -c2 $dst $gplsrc
+    diff -2 $dst $gplsrc
   fi
 done