OSDN Git Service

2007-07-04 Jim Xochellis <jimxoch@yahoo.gr>
[pf3gnuchains/gcc-fork.git] / maintainer-scripts / gcc_release
index 116bdd7..6549322 100755 (executable)
@@ -9,7 +9,7 @@
 # Contents:
 #   Script to create a GCC release.
 #
-# Copyright (c) 2001, 2002 Free Software Foundation.
+# Copyright (c) 2001, 2002, 2006 Free Software Foundation.
 #
 # This file is part of GCC.
 #
@@ -65,19 +65,19 @@ inform() {
 usage() {
 cat <<EOF
 gcc_release -r release [-f] [further options]
-gcc_release -s name:cvsbranch [further options]
+gcc_release -s name:svnbranch [further options]
 
 Options:
 
   -r release           Version of the form X.Y or X.Y.Z.
-  -s name:cvsbranch    Create a snapshot, not a real release.
+  -s name:svnbranch    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.
+  -t tag               Tag to mark the release in SVN.
   -u username          Username for upload operations.
 EOF
     exit 1
@@ -160,60 +160,38 @@ EOF
     fi
 
     # Make sure we tag the sources for a final release.
-    TAG="gcc_`echo ${RELEASE} | tr . _`_release"
+    TAG="tags/gcc_`echo ${RELEASE} | tr . _`_release"
 
     rm -rf ${SOURCE_DIRECTORY}
   fi
 
   # Tag the sources.
-  EXPORTDATE=""
   if [ -n "${TAG}" ]; then
     inform "Tagging sources as ${TAG}"
-    EXPORTTAG="${TAG}"
-    # Try to check out a file using ${TAG}.  If the command succeeds,
-    # then the sources have already been tagged.  We don't want to 
-    # overwrite an existing tag, so we don't want to use the "-F"
-    # option to "cvs rtag" below.  So, if the tag already exists,
-    # issue an error message; the release manager can manually remove
-    # the tag if appropriate.
-    echo "${SVN} ls ${SVNROOT}/${EXPORTTAG}/ChangeLog" 
-    if ${SVN} ls "${SVNROOT}/${EXPORTTAG}/ChangeLog"; then 
+    # We don't want to overwrite an existing tag.  So, if the tag
+    # already exists, issue an error message; the release manager can
+    # manually remove the tag if appropriate.
+    echo "${SVN} ls ${SVNROOT}/${TAG}/ChangeLog" 
+    if ${SVN} ls "${SVNROOT}/${TAG}/ChangeLog"; then 
       error "Tag ${TAG} already exists"
     fi
-    echo "Would execute ${SVN} cp ${SVNROOT}/${SVNBRANCH} ${SVNROOT}/${TAG}"
-    #${SVN} -m "Tagging source as ${TAG}" cp "${SVNROOT}/${SVNBRANCH}" "${SVNROOT}/${TAG}" || \
-    #  error "Could not tag sources"
-    EXPORTTAG="${SVNBRANCH}"
-  else
-    if [ ${SVNBRANCH} != "/trunk" ]; then
-      EXPORTTAG="/branches/${SVNBRANCH}"
-      # It does not work to use both "-r" and "-D" with
-      # "cvs export" so EXPORTDATE is not set here.
-    else
-      # HEAD is the default branch, no need to specify it.
-      EXPORTTAG=""
-      EXPORTDATE="-D{`date --iso-8601=minutes`}"
-    fi
+    ${SVN} -m "Tagging source as ${TAG}" cp "${SVNROOT}/${SVNBRANCH}" "${SVNROOT}/${TAG}" || \
+      error "Could not tag sources"
+    SVNBRANCH=${TAG}
   fi
+  SVNREV=`${SVN} info "${SVNROOT}/${SVNBRANCH}"|awk '/Revision:/ {print $2}'`
 
   # Export the current sources.
-  inform "Retrieving sources (svn export ${EXPORTTAG} ${EXPORTDATE} gcc)"
-
-  if [ -z "${EXPORTTAG}" ]; then
-    ${SVN} -q export ${EXPORTDATE} "${SVNROOT}/trunk" "`basename ${SOURCE_DIRECTORY}`" ||\
-      error "Could not retrieve sources"
-  elif [ -z "${EXPORTDATE}" ]; then
-    ${SVN} -q export "${SVNROOT}/${EXPORTTAG}" "`basename ${SOURCE_DIRECTORY}`/" ||\
-      error "Could not retrieve sources"
-  else
-    error "Cannot specify -r and -D at the same time"
-  fi
+  inform "Retrieving sources (svn export -r ${SVNREV} ${SVNROOT}/${SVNBRANCH})"
+
+  ${SVN} -q export -r${SVNREV} "${SVNROOT}/${SVNBRANCH}" "`basename ${SOURCE_DIRECTORY}`" ||\
+    error "Could not retrieve sources"
 
   # Run gcc_update on them to set up the timestamps nicely, and (re)write
-  # the LAST_UPDATED file containing the CVS tag/date used.
+  # the LAST_UPDATED file containing the SVN tag/revision used.
   changedir "gcc-${RELEASE}"
   contrib/gcc_update --touch
-  echo "Obtained from SVN: ${EXPORTTAG} ${EXPORTDATE}" > LAST_UPDATED
+  echo "Obtained from SVN: ${SVNBRANCH} revision ${SVNREV}" > LAST_UPDATED
 
   # Obtain some documentation files from the wwwdocs module.
   inform "Retrieving HTML documentation"
@@ -462,7 +440,7 @@ announce_snapshot() {
 and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
 
 This snapshot has been generated from the GCC "${BRANCH}" SVN branch
-with the following options: "${EXPORTTAG} ${EXPORTDATE}"
+with the following options: "svn://gcc.gnu.org/svn/gcc/${SVNBRANCH} revision ${SVNREV}"
 
 You'll find:
 " > ${SNAPSHOT_README}
@@ -486,7 +464,7 @@ we highly recommend you join the GCC developers list.  Details for
 how to sign up can be found on the GCC project home page.</p>
 
 <p>This snapshot has been generated from the GCC "${BRANCH}" SVN branch
-with the following options: <code>"svn://gcc.gnu.org/svn/gcc/${EXPORTTAG} ${EXPORTDATE}"</code></p>
+with the following options: <code>"svn://gcc.gnu.org/svn/gcc/${SVNBRANCH} revision ${SVNREV}"</code></p>
 
 <table>" > ${SNAPSHOT_INDEX}
        
@@ -540,6 +518,9 @@ Last modified "${TEXT_DATE}"
 # Initialization
 ########################################################################
 
+LC_ALL=C
+export LC_ALL
+
 # Today's date.
 DATE=`date "+%Y%m%d"`
 LONG_DATE=`date "+%Y-%m-%d"`
@@ -602,7 +583,7 @@ CPLUSPLUS_DIRS="gcc/cp libstdc++-v3"
 FORTRAN_DIRS="gcc/f libf2c"
 FORTRAN95_DIRS="gcc/fortran libgfortran"
 JAVA_DIRS="gcc/java libjava libffi fastjar zlib boehm-gc"
-OBJECTIVEC_DIRS="gcc/objc libobjc"
+OBJECTIVEC_DIRS="gcc/objc gcc/objcp libobjc"
 TESTSUITE_DIRS="gcc/testsuite"
 
 # Non-zero if this is the final release, rather than a prerelease.
@@ -718,19 +699,16 @@ if [ $SNAPSHOT -eq 0 ]; then
   # and minor release numbers.
   SVNBRANCH="branches/gcc-${RELEASE_MAJOR}_${RELEASE_MINOR}-branch"
 
-  # If this is not a final release, set various parameters acordingly.
+  # If this is not a final release, set various parameters accordingly.
   if [ ${FINAL} -ne 1 ]; then
-    RELEASE="${RELEASE}-${DATE}"
-    FTP_PATH="${FTP_PATH}/prerelease-${RELEASE}/"
+    RELEASE="${RELEASE}-RC-${DATE}"
+    FTP_PATH="${SNAPSHOTS_DIR}/${RELEASE}"
   else
     FTP_PATH="${FTP_PATH}/releases/gcc-${RELEASE}/"
   fi
 else
   RELEASE=${BRANCH}-${DATE}
   FTP_PATH="${FTP_PATH}/snapshots/${RELEASE}"
-  if [ ${SVNBRANCH} != "HEAD" ]; then
-    TAG=tags/gcc-ss-`echo ${RELEASE} | tr '.' '_'`
-  fi
 
   # If diffs are requested when building locally on gcc.gnu.org, we (usually)
   # know what the last snapshot date was and take the corresponding tarballs,
@@ -757,7 +735,8 @@ TESTSUITE_DIRS=`adjust_dirs ${TESTSUITE_DIRS}`
 
 # Set up SVNROOT.
 if [ $LOCAL -eq 0 ]; then
-    SVNROOT="svn://${SVN_USERNAME}@${SVN_SERVER}${SVN_REPOSITORY}"
+    SVNROOT="svn+ssh://${SVN_USERNAME}@${SVN_SERVER}${SVN_REPOSITORY}"
+    CVSROOT=":ext:${SVN_USERNAME}@gcc.gnu.org/cvs/gcc"
 else
     SVNROOT="file:///svn/gcc"
     CVSROOT="/cvs/gcc"