From: Zack Weinberg Date: Tue, 22 Mar 2005 06:42:33 +0000 (+0000) Subject: backport: gcc_update (silent): Unset instead of initializing to null. X-Git-Tag: releases/gcc-3.4.4~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4979272bee87c2d86e8bb58a6f6d7c3ac16a7266;p=thirdparty%2Fgcc.git backport: gcc_update (silent): Unset instead of initializing to null. Merge from mainline: 2005-03-18 Alexandre Oliva * gcc_update (silent): Unset instead of initializing to null. 2005-03-18 Andreas Schwab * gcc_update (apply_patch): Properly quote $1. 2005-03-18 Zack Weinberg * gcc_update: Add --silent option. From-SVN: r96857 --- diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 32406d46135a..84faff91d5db 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,19 @@ +2005-03-21 Zack Weinberg + + Merge from mainline: + + 2005-03-18 Alexandre Oliva + + * gcc_update (silent): Unset instead of initializing to null. + + 2005-03-18 Andreas Schwab + + * gcc_update (apply_patch): Properly quote $1. + + 2005-03-18 Zack Weinberg + + * gcc_update: Add --silent option. + 2005-01-17 David O'Brien * contrib/gcc_update: Explicitly update the branch. diff --git a/contrib/gcc_update b/contrib/gcc_update index 658d5876292f..29094e86f2d5 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -19,6 +19,9 @@ # 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 @@ -51,6 +54,15 @@ UPDATE_OPTIONS=-Pd # 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. @@ -114,7 +126,7 @@ touch_files () { 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 @@ -128,21 +140,21 @@ touch_files () { # 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 @@ -154,6 +166,13 @@ if [ ! -f gcc/version.c ]; then 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) @@ -208,8 +227,8 @@ else 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