From: Ralf Wildenhues Date: Tue, 28 Dec 2004 13:50:58 +0000 (+0000) Subject: * Makefile.am, bootstrap, clcommit.m4sh, libtoolize.m4sh, X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aecaeaf8a655318186395c9ceb2b256e61f43ca7;p=thirdparty%2Flibtool.git * Makefile.am, bootstrap, clcommit.m4sh, libtoolize.m4sh, config/ltmain.m4sh: Replace `set --' with `set dummy [...]; shift' for portability. tests/sh.test: Test for this. --- diff --git a/ChangeLog b/ChangeLog index 5edc2b135..2b7c21338 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-12-28 Ralf Wildenhues , + Gary V. Vaughan + + * Makefile.am, bootstrap, clcommit.m4sh, libtoolize.m4sh, + config/ltmain.m4sh: Replace `set --' with `set dummy [...]; shift' + for portability. tests/sh.test: Test for this. + 2004-12-28 Ralf Wildenhues * libtoolize.m4sh, config/ltmain.m4sh (most functions): diff --git a/Makefile.am b/Makefile.am index 80308c627..5d3307ca3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,7 +35,7 @@ edit = sed \ -e 's,@host_triplet\@,$(host_triplet),g' \ -e "s,@configure_input\@,Generated from $$input; do not edit by hand,g" -timestamp = set -- `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; \ +timestamp = set dummy `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; shift; \ case $(VERSION) in \ *[acegikmoqsuwy]) TIMESTAMP=" $$1 $$2 $$3" ;; \ *) TIMESTAMP="" ;; \ @@ -74,7 +74,7 @@ aclocal_DATA = m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 \ MKSTAMP = $(SHELL) $(top_srcdir)/config/mkstamp $(top_srcdir)/stamp-vcl: vcl-tmp clean-ltmain-sh ChangeLog vcl-tmp: - @set -- `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; \ + @set dummy `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; shift; \ echo "$$1" > vcl.tmp; \ cmp -s vcl.tmp $(top_srcdir)/stamp-vcl \ || (echo "Updating stamp-vcl"; cp vcl.tmp $(top_srcdir)/stamp-vcl) @@ -97,7 +97,7 @@ clean-ltmain-sh: # how ltversion.m4 appears in our dependencies. EXTRA_DIST += m4/ltversion.in m4/ltversion.m4 $(top_srcdir)/m4/ltversion.m4: m4/ltversion.in configure.ac $(top_srcdir)/stamp-vcl - set -- `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; \ + set dummy `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; shift; \ cd $(top_srcdir); \ rm -f m4/ltversion.tmp; \ serial=`echo $$1 | sed 's,^1[.],,g'`; \ diff --git a/bootstrap b/bootstrap index 26fb4eb79..a164041a0 100755 --- a/bootstrap +++ b/bootstrap @@ -49,7 +49,8 @@ if test -z "$reconfdirs"; then fi # Extract the package name and version number from configure.ac: -set -- `sed '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac` +set dummy `sed '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac` +shift # Building distributed files from configure is bad for automake, so we # generate them here, and have Makefile rules to keep them up to date. diff --git a/clcommit.m4sh b/clcommit.m4sh index ae2cb801e..dfd338813 100644 --- a/clcommit.m4sh +++ b/clcommit.m4sh @@ -130,7 +130,7 @@ set -e set -x ;; - --fast) set -- --force --first ${1+"$@"} ;; + --fast) set dummy --force --first ${1+"$@"}; shift ;; -f|--force) opt_update=false; PAGER=cat ;; @@ -200,7 +200,8 @@ set -e fi # The funny quoting allows keeping one option per # line in $rc_file: - eval set -- `echo \`cat $rc_file\` \\\${1+\"\\\$@\"}` + eval set dummy `echo \`cat $rc_file\` \\\${1+\"\\\$@\"}` + shift ;; -s|--sendmail) test $# = 0 && func_missing_arg $opt && break @@ -246,21 +247,24 @@ set -e --*=*) arg=`echo "$opt" | $SED "$my_sed_long_arg"` opt=`echo "$opt" | $SED "$my_sed_long_opt"` - set -- "$opt" "$arg" ${1+"$@"} + set dummy "$opt" "$arg" ${1+"$@"} + shift ;; # Separate optargs to short options: -m*|-F*|-C*|-S*|-s*|-z*) arg=`echo "$opt" |$SED "$my_sed_single_rest"` opt=`echo "$opt" |$SED "$my_sed_single_opt"` - set -- "$opt" "$arg" ${1+"$@"} + set dummy "$opt" "$arg" ${1+"$@"} + shift ;; # Separate non-argument short options: -f*|-1*|-n*|-q*) rest=`echo "$opt" |$SED "$my_sed_single_rest"` opt=`echo "$opt" |$SED "$my_sed_single_opt"` - set -- "$opt" "-$rest" ${1+"$@"} + set dummy "$opt" "-$rest" ${1+"$@"} + shift ;; -\?|-h) func_usage ;; @@ -268,7 +272,7 @@ set -e --version) func_version ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set -- "$opt" ${1+"$@"}; break ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done diff --git a/config/ltmain.m4sh b/config/ltmain.m4sh index 8313ede41..008b96abd 100644 --- a/config/ltmain.m4sh +++ b/config/ltmain.m4sh @@ -407,25 +407,25 @@ Otherwise, only FILE itself is deleted using RM." # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) - shift; set -- --mode clean ${1+"$@"} + shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) - shift; set -- --mode compile ${1+"$@"} + shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) - shift; set -- --mode execute ${1+"$@"} + shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) - shift; set -- --mode finish ${1+"$@"} + shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) - shift; set -- --mode install ${1+"$@"} + shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) - shift; set -- --mode link ${1+"$@"} + shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set -- --mode uninstall ${1+"$@"} + shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac @@ -495,21 +495,24 @@ Otherwise, only FILE itself is deleted using RM." -dlopen=*|--mode=*|--tag=*) arg=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"` opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"` - set -- "$opt" "$arg" ${1+"$@"} + set dummy "$opt" "$arg" ${1+"$@"} + shift ;; # Separate optargs to short options: # -x*|-y*) # arg=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"` # opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"` -# set -- "$opt" "$arg" ${1+"$@"} +# set dummy "$opt" "$arg" ${1+"$@"} +# shift # ;; # Separate non-argument short options: # -z*|-z*|-y*) # rest=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"` # opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"` -# set -- "$opt" "-$rest" ${1+"$@"} +# set dummy "$opt" "-$rest" ${1+"$@"} +# shift # ;; -\?|-h) func_usage ;; diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 578ddc6b2..edd482087 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -150,14 +150,16 @@ configure_ac=configure.in --ltdl=*) arg=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"` opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"` - set -- "$opt" "$arg" ${1+"$@"} + set dummy "$opt" "$arg" ${1+"$@"} + shift ;; # Separate non-argument short options: -c*|-i*|-f*|-n*|-q*|-v*) rest=`$ECHO "X$opt" | $Xsed -e "$my_sed_single_rest"` opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_single_opt"` - set -- "$opt" "-$rest" ${1+"$@"} + set dummy "$opt" "-$rest" ${1+"$@"} + shift ;; -\?|-h) func_usage ;; diff --git a/tests/sh.test b/tests/sh.test index 7ef94a354..0b5be69f9 100755 --- a/tests/sh.test +++ b/tests/sh.test @@ -75,4 +75,10 @@ if $EGREP -n -e '"[^`"]*`[^"`]*"[^"`]*".*`[^`"]*"' $scripts | \ status=$EXIT_FAILURE fi +# Check for using set -- instead of set dummy +if $EGREP -n -e 'set[ ]+--[ ]+' $scripts; then + echo "use \`set dummy ...' instead of \`set -- ...'" + status=$EXIT_FAILURE +fi + exit $status