+2005-03-21 Zack Weinberg <zack@codesourcery.com>
+
+ Merge from mainline:
+
+ 2005-03-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc_update (silent): Unset instead of initializing to null.
+
+ 2005-03-18 Andreas Schwab <schwab@suse.de>
+
+ * gcc_update (apply_patch): Properly quote $1.
+
+ 2005-03-18 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc_update: Add --silent option.
+
2005-01-17 David O'Brien <obrien@FreeBSD.org>
* contrib/gcc_update: Explicitly update the branch.
# If the first parameter is --list, a list of the generated files and
# their dependencies will be printed; --help prints this message.
#
+# If the first parameter is --silent, this script prints nothing other
+# than error messages; the second parameter is then interpreted as above.
+#
# Examples:
#
# contrib/gcc_update -r gcc_latest_snapshot
# Arrange for the value of $0 to be available for functions
self=$0
+# This function prints its arguments to standard output unless
+# "silent" is set.
+unset silent
+chat () {
+ if [ -z "$silent" ]; then
+ echo "$@"
+ fi
+}
+
# This function prints a list of all generated files, along with their
# dependencies. Note that only one target is supported per line: the
# colon is stripped from the output.
echo ':' >> Makefile.$$
echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$
echo ' echo Touching $@...; \' >> Makefile.$$
- echo ' echo Touching $@... 1>&2; \' >> Makefile.$$
+ chat ' echo Touching $@... 1>&2; \' >> Makefile.$$
echo ' touch $@' >> Makefile.$$
files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$
while ${MAKE-make} -s -f Makefile.$$ all | grep . > /dev/null; do
# this script. By re-execing it, we ensure that the appropriate
# dependencies and rules will be used.
touch_files_reexec () {
- echo "Adjusting file timestamps"
- exec ${CONFIG_SHELL-/bin/sh} $self --touch
+ chat "Adjusting file timestamps"
+ exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch
}
# This functions applies a patch to an existing tree.
apply_patch () {
- if [ -f $1 ]; then
+ if [ -f "$1" ]; then
echo "Applying patch file $1"
- case "$1" in
+ case $1 in
*gz)
- gzip -d -c $1 | patch -p1 ;;
+ gzip -d -c "$1" | patch -p1 ;;
*bz2)
- bzip2 -d -c $1 | patch -p1 ;;
+ bzip2 -d -c "$1" | patch -p1 ;;
*)
- cat $1 | patch -p1 ;;
+ patch -p1 < "$1";;
esac
fi
touch_files_reexec
exit
fi
+case "$1" in
+--silent)
+ silent=t
+ shift
+ ;;
+esac
+
case "$1" in
# First of all, check whether we are going to process a patch.
--patch)
set -- $UPDATE_OPTIONS ${1+"$@"}
fi
-echo "Updating CVS tree"
-$GCC_CVS -q update -r gcc-3_4-branch ${1+"$@"}
+chat "Updating CVS tree"
+$GCC_CVS -q ${silent+-Q} update -r gcc-3_4-branch ${1+"$@"}
if [ $? -ne 0 ]; then
(touch_files_reexec)
echo "CVS update of full tree failed." >&2