From 5444dcf4d4e1c4b8dee21fad412f8843ec8cebb8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 8 Jul 2003 23:33:45 +0000 Subject: [PATCH] * 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". --- config/ChangeLog | 7 +++++++ config/srclist-update | 28 +++++++++++++++------------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index dbad7786a..52c0a3d39 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,10 @@ +2003-07-08 Paul Eggert + + * 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 * depcomp: update from automake. diff --git a/config/srclist-update b/config/srclist-update index 74438f9dc..cbe1af529 100755 --- 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 @@ 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 } # 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 -C 2 $dst $gplsrc fi done -- 2.11.0