diff mbox

Change gcc_release for 5+

Message ID 20150413081532.GH1735@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek April 13, 2015, 8:15 a.m. UTC
On Mon, Apr 13, 2015 at 09:44:12AM +0200, Richard Biener wrote:
> > @@ -130,8 +130,20 @@ EOF
> >  
> >      # Update gcc/DEV-PHASE.
> >  
> > -    [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ] || \
> > -    error "Release number ${RELEASE} does not match BASE-VER"
> > +    if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ]; then

Guess it should be !=, you're right.

> > +      if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` \
> > +	   = ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \
> > +	   -a x${RELEASE_REVISION} = x0 ]; then
> > +	(changedir ${SOURCE_DIRECTORY}/gcc && \
> > +	 echo ${RELEASE} > BASE-VER && \
> > +	 ${SVN} -q ci -m 'Bump release' BASE-VER) || \
> > +	error "Could not update BASE-VER"
> > +      else
> > +	error "Release number ${RELEASE} does not match BASE-VER"
> 
> "... does not immediately follow BASE-VER"

Ok.

I've committed the patch in the meantime (because the second hunk was really
needed immediately).
So here is incremental patch that hopefully fixes what you found and
also changes it to commit everything at once.

Does it look ok?  I guess I'll add a echo of then svn ci arguments and
exit 1 right before the svn ci to test it without committing anything.

2015-04-13  Jakub Jelinek  <jakub@redhat.com>

	* gcc_release: Fix up thinko in the last commit, improve error
	message.  Commit all ChangeLog, DEV-PHASE and BASE-VER changes
	together, rather than doing dozens of separate commits.



	Jakub

Comments

Richard Biener April 13, 2015, 8:26 a.m. UTC | #1
On Mon, 13 Apr 2015, Jakub Jelinek wrote:

> On Mon, Apr 13, 2015 at 09:44:12AM +0200, Richard Biener wrote:
> > > @@ -130,8 +130,20 @@ EOF
> > >  
> > >      # Update gcc/DEV-PHASE.
> > >  
> > > -    [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ] || \
> > > -    error "Release number ${RELEASE} does not match BASE-VER"
> > > +    if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ]; then
> 
> Guess it should be !=, you're right.
> 
> > > +      if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` \
> > > +	   = ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \
> > > +	   -a x${RELEASE_REVISION} = x0 ]; then
> > > +	(changedir ${SOURCE_DIRECTORY}/gcc && \
> > > +	 echo ${RELEASE} > BASE-VER && \
> > > +	 ${SVN} -q ci -m 'Bump release' BASE-VER) || \
> > > +	error "Could not update BASE-VER"
> > > +      else
> > > +	error "Release number ${RELEASE} does not match BASE-VER"
> > 
> > "... does not immediately follow BASE-VER"
> 
> Ok.
> 
> I've committed the patch in the meantime (because the second hunk was really
> needed immediately).
> So here is incremental patch that hopefully fixes what you found and
> also changes it to commit everything at once.
> 
> Does it look ok?  I guess I'll add a echo of then svn ci arguments and
> exit 1 right before the svn ci to test it without committing anything.

Looks good to me.

Richard.

> 2015-04-13  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* gcc_release: Fix up thinko in the last commit, improve error
> 	message.  Commit all ChangeLog, DEV-PHASE and BASE-VER changes
> 	together, rather than doing dozens of separate commits.
> 
> --- gcc/maintainer-scripts/gcc_release.jj	2015-04-12 22:45:36.000000000 +0200
> +++ gcc/maintainer-scripts/gcc_release	2015-04-13 10:06:43.847201786 +0200
> @@ -109,45 +109,49 @@ build_sources() {
>  
>      ${SVN} -q co "${SVNROOT}/${SVNBRANCH}" "`basename ${SOURCE_DIRECTORY}`" ||\
>             error "Could not check out release sources"
> -    for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do
> +    svnciargs=""
> +    for x in `changedir ${SOURCE_DIRECTORY} && \
> +	      find . -name ChangeLog`; do
>        # Update this ChangeLog file only if it does not yet contain the
>        # entry we are going to add.  (This is a safety net for repeated
>        # runs of this script for the same release.)
> -      if ! grep "GCC ${RELEASE} released." ${x} > /dev/null ; then       
> -        cat - ${x} > ${x}.new <<EOF
> +      if ! grep "GCC ${RELEASE} released." ${SOURCE_DIRECTORY}/${x} > /dev/null ; then       
> +	cat - ${SOURCE_DIRECTORY}/${x} > ${SOURCE_DIRECTORY}/${x}.new <<EOF
>  ${LONG_DATE}  Release Manager
>  
>  	* GCC ${RELEASE} released.
>  
>  EOF
> -        mv ${x}.new ${x} || \
> -            error "Could not update ${x}"
> -        (changedir `dirname ${x}` && \
> -            ${SVN} -q ci -m 'Mark ChangeLog' `basename ${x}`) || \
> -            error "Could not commit ${x}"
> +	mv ${SOURCE_DIRECTORY}/${x}.new ${SOURCE_DIRECTORY}/${x} \
> +	  || error "Could not update ${x}"
> +	svnciargs="${svnciargs} ${x}"
>        fi
>      done
>  
>      # Update gcc/DEV-PHASE.
>  
> -    if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ]; then
> +    if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` != ${RELEASE} ]; then
>        [ ${RELEASE_MAJOR} -lt 5 ] && \
>  	error "Release number ${RELEASE} does not match BASE-VER"
>        if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` \
>  	   = ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \
>  	   -a x${RELEASE_REVISION} = x0 ]; then
>  	(changedir ${SOURCE_DIRECTORY}/gcc && \
> -	 echo ${RELEASE} > BASE-VER && \
> -	 ${SVN} -q ci -m 'Bump release' BASE-VER) || \
> +	 echo ${RELEASE} > BASE-VER) || \
>  	error "Could not update BASE-VER"
> +	svnciargs="${svnciargs} gcc/BASE-VER"
>        else
> -	error "Release number ${RELEASE} does not match BASE-VER"
> +	error "Release number ${RELEASE} does not immediately follow BASE-VER"
>        fi
>      fi
>      (changedir ${SOURCE_DIRECTORY}/gcc && \
> -     : > DEV-PHASE && \
> -     ${SVN} -q ci -m 'Mark as release' DEV-PHASE) || \
> +     : > DEV-PHASE) || \
>      error "Could not update DEV-PHASE"
> +    svnciargs="${svnciargs} gcc/DEV-PHASE"
> +
> +    (changedir ${SOURCE_DIRECTORY} && \
> +     ${SVN} -q ci -m 'Update ChangeLog and version files for release' ${svnciargs}) || \
> +    error "Could not commit ChangeLog and version file updates"
>  
>      # Make sure we tag the sources for a final release.
>      TAG="tags/gcc_`echo ${RELEASE} | tr . _`_release"
> 
> 
> 	Jakub
> 
>
diff mbox

Patch

--- gcc/maintainer-scripts/gcc_release.jj	2015-04-12 22:45:36.000000000 +0200
+++ gcc/maintainer-scripts/gcc_release	2015-04-13 10:06:43.847201786 +0200
@@ -109,45 +109,49 @@  build_sources() {
 
     ${SVN} -q co "${SVNROOT}/${SVNBRANCH}" "`basename ${SOURCE_DIRECTORY}`" ||\
            error "Could not check out release sources"
-    for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do
+    svnciargs=""
+    for x in `changedir ${SOURCE_DIRECTORY} && \
+	      find . -name ChangeLog`; do
       # Update this ChangeLog file only if it does not yet contain the
       # entry we are going to add.  (This is a safety net for repeated
       # runs of this script for the same release.)
-      if ! grep "GCC ${RELEASE} released." ${x} > /dev/null ; then       
-        cat - ${x} > ${x}.new <<EOF
+      if ! grep "GCC ${RELEASE} released." ${SOURCE_DIRECTORY}/${x} > /dev/null ; then       
+	cat - ${SOURCE_DIRECTORY}/${x} > ${SOURCE_DIRECTORY}/${x}.new <<EOF
 ${LONG_DATE}  Release Manager
 
 	* GCC ${RELEASE} released.
 
 EOF
-        mv ${x}.new ${x} || \
-            error "Could not update ${x}"
-        (changedir `dirname ${x}` && \
-            ${SVN} -q ci -m 'Mark ChangeLog' `basename ${x}`) || \
-            error "Could not commit ${x}"
+	mv ${SOURCE_DIRECTORY}/${x}.new ${SOURCE_DIRECTORY}/${x} \
+	  || error "Could not update ${x}"
+	svnciargs="${svnciargs} ${x}"
       fi
     done
 
     # Update gcc/DEV-PHASE.
 
-    if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ]; then
+    if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` != ${RELEASE} ]; then
       [ ${RELEASE_MAJOR} -lt 5 ] && \
 	error "Release number ${RELEASE} does not match BASE-VER"
       if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` \
 	   = ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \
 	   -a x${RELEASE_REVISION} = x0 ]; then
 	(changedir ${SOURCE_DIRECTORY}/gcc && \
-	 echo ${RELEASE} > BASE-VER && \
-	 ${SVN} -q ci -m 'Bump release' BASE-VER) || \
+	 echo ${RELEASE} > BASE-VER) || \
 	error "Could not update BASE-VER"
+	svnciargs="${svnciargs} gcc/BASE-VER"
       else
-	error "Release number ${RELEASE} does not match BASE-VER"
+	error "Release number ${RELEASE} does not immediately follow BASE-VER"
       fi
     fi
     (changedir ${SOURCE_DIRECTORY}/gcc && \
-     : > DEV-PHASE && \
-     ${SVN} -q ci -m 'Mark as release' DEV-PHASE) || \
+     : > DEV-PHASE) || \
     error "Could not update DEV-PHASE"
+    svnciargs="${svnciargs} gcc/DEV-PHASE"
+
+    (changedir ${SOURCE_DIRECTORY} && \
+     ${SVN} -q ci -m 'Update ChangeLog and version files for release' ${svnciargs}) || \
+    error "Could not commit ChangeLog and version file updates"
 
     # Make sure we tag the sources for a final release.
     TAG="tags/gcc_`echo ${RELEASE} | tr . _`_release"