OSDN Git Service

* jvspec.c (jvgenmain_spec): Added `*' after fassume-compiled and
[pf3gnuchains/gcc-fork.git] / maintainer-scripts / gcc_release
index 0f8f5be..df6ad80 100755 (executable)
 #
 # Copyright (c) 2001, 2002 Free Software Foundation.
 #
-# This file is part of GNU CC.
+# This file is part of GCC.
 #
-# GNU CC is free software; you can redistribute it and/or modify
+# GCC is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2, or (at your option)
 # any later version.
 #
-# GNU CC is distributed in the hope that it will be useful,
+# GCC is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU CC; see the file COPYING.  If not, write to
+# along with GCC; see the file COPYING.  If not, write to
 # the Free Software Foundation, 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 #
@@ -64,12 +64,21 @@ inform() {
 
 usage() {
 cat <<EOF
-gcc_release     [-d destination]
-                [-u username]
-               [-r release]
-               [-t tag]
-               [-p previous-tarball]
-               [-s] [-f] [-l]
+gcc_release -r release [further options]
+gcc_release -s [further options]
+
+Options:
+
+  -r release           Version of the form X.Y or X.Y.Z.
+  -s                   Create a snapshot, not a real release.
+
+  -d destination       Local working directory where we will build the release
+                       (default=${HOME}).
+  -f                   Create a final release (and update ChangeLogs,...).
+  -l                   Indicate that we are running on gcc.gnu.org.
+  -p previous-tarball  Location of a previous tarball (to generate diff files).
+  -t tag               Tag to mark the release in CVS.
+  -u username          Username for upload operations.
 EOF
     exit 1
 }
@@ -113,21 +122,25 @@ build_sources() {
            -r ${BRANCH} gcc || \
            error "Could not check out release sources"
     for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do
-      cat - ${x} > ${x}.new <<EOF
+      # 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
 ${LONG_DATE}  Release Manager
 
-       * GCC ${RELEASE} Released.
+       * GCC ${RELEASE} released.
 
 EOF
-      mv ${x}.new ${x} || \
-        error "Could not update ${x}"
-      (changedir `dirname ${x}` && \
-        ${CVS} ci -m 'Mark ChangeLog' `basename ${x}`) || \
-        error "Could not commit ${x}"
+        mv ${x}.new ${x} || \
+            error "Could not update ${x}"
+        (changedir `dirname ${x}` && \
+            ${CVS} ci -m 'Mark ChangeLog' `basename ${x}`) || \
+            error "Could not commit ${x}"
+      fi
     done
 
-    # Update `gcc/version.c'.  There are other version files
-    # as well, which should have release status updated.
+    # Update `gcc/version.c'.
     for x in gcc/version.c; do 
       y=`basename ${x}`
       (changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
@@ -136,15 +149,6 @@ EOF
           ${CVS} ci -m 'Update version' ${y}) || \
          error "Could not update ${x}"
     done
-    for x in gcc/ada/gnatvsn.ads gcc/f/version.c libf2c/libF77/Version.c \
-             libf2c/libI77/Version.c libf2c/libU77/Version.c; do
-      y=`basename ${x}`
-      (changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
-          sed -e 's/experimental\|prerelease/release/g' < ${y} > ${y}.new && \
-         mv ${y}.new ${y} && \
-          ${CVS} ci -m 'Update version' ${y}) || \
-         error "Could not update ${x}"
-    done
 
     # Make sure we tag the sources for a final release.
     TAG="gcc_`echo ${RELEASE} | tr . _`_release"
@@ -302,7 +306,11 @@ build_diffs() {
   for f in gcc gcc-ada gcc-g++ gcc-g77 gcc-java gcc-objc gcc-testsuite gcc-core; do
     old_tar=${old_dir}/${f}-${old_vers}.tar.gz
     new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.gz
-    if [ -e $old_tar ] && [ -e $new_tar ]; then
+    if [ ! -e $old_tar ]; then
+      inform "$old_tar not found; not generating diff file"
+    elif [ ! -e $new_tar ]; then
+      inform "$new_tar not found; not generating diff file"
+    else
       build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \
         ${f}-${old_vers}-${RELEASE}.diff.gz
     fi
@@ -336,20 +344,30 @@ upload_files() {
 
   # Make sure the directory exists on the server.
   if [ $LOCAL -eq 0 ]; then
-    ${SSH} -l ${GCC_USERNAME} ${GCC_HOSTNAME} mkdir ${FTP_PATH}
+    ${SSH} -l ${GCC_USERNAME} ${GCC_HOSTNAME} \
+      mkdir -p "${FTP_PATH}/diffs"
     UPLOAD_PATH="${GCC_USERNAME}@${GCC_HOSTNAME}:${FTP_PATH}"
   else
-    mkdir -p "${FTP_PATH}" \
+    mkdir -p "${FTP_PATH}/diffs" \
       || error "Could not create \`${FTP_PATH}'"
     UPLOAD_PATH=${FTP_PATH}
   fi
 
+  # Then copy files to their respective (sub)directories.
   for x in gcc*.gz gcc*.bz2; do
     if [ -e ${x} ]; then
       # Make sure the file will be readable on the server.
       chmod a+r ${x}
       # Copy it.
-      ${SCP} ${x} ${UPLOAD_PATH} || error "Could not upload ${x}"
+      case ${x} in
+        *.diff.*)
+          SUBDIR="diffs/";
+          ;;
+        *)
+          SUBDIR="";
+      esac
+      ${SCP} ${x} ${UPLOAD_PATH}/${SUBDIR} \
+        || error "Could not upload ${x}"
     fi
   done
 }
@@ -517,8 +535,8 @@ if [ $SNAPSHOT -eq 0 ]; then
   fi
 else
   RELEASE=$DATE
-  # For now snapshots come from the 3.2 branch.
-  BRANCH=gcc-3_2-branch
+  # For now snapshots come from the 3.3 branch.
+  BRANCH=gcc-3_3-branch
   FTP_PATH="${FTP_PATH}/snapshots/${LONG_DATE}"
   TAG=gcc_ss_${DATE}