changeset 4420:4d53589600c0

* 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".
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 08 Jul 2003 23:33:45 +0000
parents 9b828c973b9d
children ea7c1b0124e7
files config/ChangeLog config/srclist-update
diffstat 2 files changed, 22 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -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.
--- a/config/srclist-update
+++ b/config/srclist-update
@@ -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 @@
 #
 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
 }
 
 
 # 
 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 @@
   # 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 @@
     $verbose && echo "## $gplsrc $dst  # unchanged"
   else
     echo "## $gplsrc $dst  # changes"
-    diff -c2 $dst $gplsrc
+    diff -C 2 $dst $gplsrc
   fi
 done