+2004-12-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>,
+ Gary V. Vaughan <gary@gnu.org>
+
+ * 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 <Ralf.Wildenhues@gmx.de>
* libtoolize.m4sh, config/ltmain.m4sh (most functions):
-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="" ;; \
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)
# 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'`; \
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.
set -x
;;
- --fast) set -- --force --first ${1+"$@"} ;;
+ --fast) set dummy --force --first ${1+"$@"}; shift ;;
-f|--force) opt_update=false; PAGER=cat ;;
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
--*=*)
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 ;;
--version) func_version ;;
--) break ;;
-*) func_fatal_help "unrecognized option \`$opt'" ;;
- *) set -- "$opt" ${1+"$@"}; break ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
esac
done
# 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
-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 ;;
--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 ;;
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