]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: gcc_update (silent): Unset instead of initializing to null.
authorZack Weinberg <zack@codesourcery.com>
Tue, 22 Mar 2005 06:42:33 +0000 (06:42 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Tue, 22 Mar 2005 06:42:33 +0000 (06:42 +0000)
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.

From-SVN: r96857

contrib/ChangeLog
contrib/gcc_update

index 32406d46135a594046196a7fc2978813729b6e77..84faff91d5db7ca5c5f1ea46393f8478d0135ab6 100644 (file)
@@ -1,3 +1,19 @@
+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.
index 658d5876292fe95b00859e5fa476e1807ef8bed0..29094e86f2d5da22fa205ed914e38d878d8f8eac 100755 (executable)
@@ -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