Hi!

I got a failure when trying to do 6.5 release, because
"^GCC 6.5" didn't match in the expected portion of NEWS, there was only
   GCC 6.5
This patch accepts whitespace before it and makes the checks consistent,
also it doesn't print just the first argument on error/inform, but all of
them (needed because some messages were too long and split across lines).

Committed to trunk.

2018-10-26  Jakub Jelinek  <ja...@redhat.com>

        * gcc_release (error, inform): Use $@ instead of $1.
        (build_sources): Check for ^[[:blank:]]*GCC in both index.html
        and changes.html, rather than for GCC in one and ^GCC in another one.

--- maintainer-scripts/gcc_release.jj   2018-05-03 11:28:30.199330419 +0200
+++ maintainer-scripts/gcc_release      2018-10-26 12:24:04.263072882 +0200
@@ -45,18 +45,18 @@
 # Functions
 ########################################################################
 
-# Issue the error message given by $1 and exit with a non-zero
+# Issue the error message given by $@ and exit with a non-zero
 # exit code.
 
 error() {
-    echo "gcc_release: error: $1"
+    echo "gcc_release: error: $@"
     exit 1
 }
 
-# Issue the informational message given by $1.
+# Issue the informational message given by $@.
 
 inform() {
-    echo "gcc_release: $1"
+    echo "gcc_release: $@"
 }
 
 # Issue a usage message explaining how to use this script.
@@ -128,12 +128,12 @@ build_sources() {
     previndex="http:\/\/gcc.gnu.org\/gcc-`expr ${RELEASE_MAJOR} - 
1`\/index.html"
     sed -n -e "/^${thisindex}/,/^${thischanges}/p" NEWS |\
           sed -n -e "/Release History/,/References and Acknowledgments/p" |\
-          grep -q "GCC ${RELEASE_MAJOR}.${RELEASE_MINOR}" ||\
+          grep -q "^[[:blank:]]*GCC ${RELEASE_MAJOR}.${RELEASE_MINOR}" ||\
           error "GCC ${RELEASE_MAJOR}.${RELEASE_MINOR} not mentioned "\
                 "in gcc-${RELEASE_MAJOR}/index.html"
 
     sed -n -e "/^${thischanges}/,/^${previndex}/p" NEWS |\
-          grep -q "^GCC ${RELEASE_MAJOR}.${RELEASE_MINOR}" ||\
+          grep -q "^[[:blank:]]*GCC ${RELEASE_MAJOR}.${RELEASE_MINOR}" ||\
           error "GCC ${RELEASE_MAJOR}.${RELEASE_MINOR} not mentioned "\
                 "in gcc-${RELEASE_MAJOR}/changes.html"
 

        Jakub

Reply via email to