OSDN Git Service

2004-08-03 Kelley Cook <kcook@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / maintainer-scripts / gcc_release
index 3ac73da..8d49ce9 100755 (executable)
@@ -160,7 +160,10 @@ EOF
   EXPORTDATE=""
   if [ -n "${TAG}" ]; then
     inform "Tagging sources as ${TAG}"
-    ${CVS} rtag -r ${CVSBRANCH} -F ${TAG} gcc || \
+    # The -F option to CVS is intentionally not used below.  If you
+    # need to retry a release, you will have to manually remove any
+    # existing tag.
+    ${CVS} rtag -r ${CVSBRANCH} ${TAG} gcc || \
       error "Could not tag sources"
     EXPORTTAG="-r${TAG}"
   else
@@ -229,7 +232,7 @@ EOF
     ${SOURCE_DIRECTORY}/gcc/doc/install.texi2html
 
     # Regenerate the NEWS file.
-    contrib/gennews > gcc/NEWS || \
+    contrib/gennews > NEWS || \
       error "Could not regenerate NEWS files"
 
     # Now, we must build the compiler in order to create any generated
@@ -245,21 +248,16 @@ EOF
 
   # Move message catalogs to source directory.
   mv ../objdir/gcc/po/*.gmo gcc/po/
+  [ -f libcpp/po/cpplib.pot ] && mv ../objdir/libcpp/po/*.gmo libcpp/po/
 
-  # Create a `.brik' file to use for checking the validity of the
-  # release.
-  changedir "${SOURCE_DIRECTORY}"
-  BRIK_FILE=`mktemp /tmp/gcc_release.XXXXXXX`
-  ((find . -type f | sort > $BRIK_FILE) && \
-       brik -Gb -f ${BRIK_FILE} > .brik && \
-       rm ${BRIK_FILE}) || \
-     error "Could not compute brik checksum"
+  # Create a "MD5SUMS" file to use for checking the validity of the release.
+  find . -type f |sed -e 's:^\./::' -e '/MD5SUMS/d' |sort |xargs md5sum >MD5SUMS
 }
 
 # Buid a single tarfile.  The first argument is the name of the name
 # of the tarfile to build, without any suffixes.  They will be added
 # automatically.  The rest of the arguments are the files or
-# directories to include.
+# directories to include, and possibly other arguments to tar.
 
 build_tarfile() {
   # Get the name of the destination tar file.
@@ -272,6 +270,25 @@ build_tarfile() {
   FILE_LIST="${FILE_LIST} ${TARFILE}"
 }
 
+# Build a single tarfile if any of the directories listed exist,
+# but not if none of them do (because that component doesn't exist
+# on this branch).
+maybe_build_tarfile() {
+  dest=$1
+  shift
+  dir_exists=0
+  for maybe_dir in "$@"; do
+    if [ -d "$maybe_dir" ]; then
+      dir_exists=1
+    fi
+  done
+  if [ $dir_exists = 1 ]; then
+    build_tarfile "$dest" "$@"
+  else
+    echo "Not building $dest tarfile"
+  fi
+}
+
 # Build the various tar files for the release.
 
 build_tarfiles() {
@@ -289,16 +306,17 @@ build_tarfiles() {
   build_tarfile gcc-${RELEASE} `basename ${SOURCE_DIRECTORY}`
 
   # Now, build one for each of the languages.
-  build_tarfile gcc-ada-${RELEASE} ${ADA_DIRS}
-  build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
-  build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
-  build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
-  build_tarfile gcc-objc-${RELEASE} ${OBJECTIVEC_DIRS}
-  build_tarfile gcc-testsuite-${RELEASE} ${TESTSUITE_DIRS}
+  maybe_build_tarfile gcc-ada-${RELEASE} ${ADA_DIRS}
+  maybe_build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
+  maybe_build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
+  maybe_build_tarfile gcc-fortran-${RELEASE} ${FORTRAN95_DIRS}
+  maybe_build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
+  maybe_build_tarfile gcc-objc-${RELEASE} ${OBJECTIVEC_DIRS}
+  maybe_build_tarfile gcc-testsuite-${RELEASE} ${TESTSUITE_DIRS}
    
   # The core is everything else.
   EXCLUDES=""
-  for x in ${ADA_DIRS} ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} \
+  for x in ${ADA_DIRS} ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} ${FORTRAN95_DIRS}\
           ${JAVA_DIRS} ${OBJECTIVEC_DIRS} ${TESTSUITE_DIRS}; do
     EXCLUDES="${EXCLUDES} --exclude $x"
   done
@@ -321,7 +339,7 @@ build_diffs() {
   old_vers=${old_file%.tar.bz2}
   old_vers=${old_vers#gcc-}
   inform "Building diffs against version $old_vers"
-  for f in gcc gcc-ada gcc-g++ gcc-g77 gcc-java gcc-objc gcc-testsuite gcc-core; do
+  for f in gcc gcc-ada gcc-g++ gcc-g77 gcc-fortran gcc-java gcc-objc gcc-testsuite gcc-core; do
     old_tar=${old_dir}/${f}-${old_vers}.tar.bz2
     new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.bz2
     if [ ! -e $old_tar ]; then
@@ -389,36 +407,110 @@ upload_files() {
   done
 }
 
+#Print description if snapshot exists
+snapshot_print() {
+  if [ -e ${RELEASE}/${SNAP_FILE} ]; then
+     printf "%-38s%s\n\n" "${SNAP_FILE}" "${SNAP_DESCRIPTION}" >> ${SNAPSHOT_README}
+     echo -e "  <tr><td><a href=\"${SNAP_FILE}\">${SNAP_FILE}</a></td>\n" \
+             "      <td>${SNAP_DESCRIPTION}</td></tr>" >> ${SNAPSHOT_INDEX}
+  fi
+}
+
 # Announce a snapshot, both on the web and via mail.
 announce_snapshot() {
   inform "Updating links and READMEs on the FTP server"
   
   TEXT_DATE=`date --date=$DATE +%B\ %d,\ %Y`
+  SNAPSHOT_README=${RELEASE}/README
+  SNAPSHOT_INDEX=${RELEASE}/index.html
+
   changedir "${SNAPSHOTS_DIR}"
-  sed -e "s%@DATE@%$DATE%g" \
-    -e "s%@TEXT_DATE@%$TEXT_DATE%g" \
-    -e "s%@LAST_DATE@%$LAST_DATE%g" \
-    -e "s%@BRANCH@%${BRANCH}%g" \
-    -e "s%@RELEASE@%${RELEASE}%g" \
-    -e "s%@EXPORT@%${EXPORTTAG} ${EXPORTDATE}%g" \
-    ~/scripts/snapshot-README > $$
-  mv $$ ${RELEASE}/README
-  sed -e "s%@DATE@%$DATE%g" \
-    -e "s%@TEXT_DATE@%$TEXT_DATE%g" \
-    -e "s%@LAST_DATE@%$LAST_DATE%g" \
-    -e "s%@BRANCH@%${BRANCH}%g" \
-    -e "s%@RELEASE@%${RELEASE}%g" \
-    -e "s%@EXPORT@%${EXPORTTAG} ${EXPORTDATE}%g" \
-    ~/scripts/snapshot-index.html > $$
-  mv $$ ${RELEASE}/index.html
-
-  touch LATEST-IS-${BRANCH}-${DATE}
-  rm -f LATEST-IS-${BRANCH}-${LAST_DATE}
+  echo -e "Snapshot gcc-"${RELEASE}" is now available on" \
+          "\n  ftp://gcc.gnu.org/pub/gcc/snapshots/"${RELEASE}"/" \
+          "\nand on various mirrors, see http://gcc.gnu.org/mirrors.html for details." \
+          "\n\nThis snapshot has been generated from the GCC "${BRANCH}" CVS branch" \
+          "\nwith the following options: "${EXPORTTAG} ${EXPORTDATE} \
+          "\n\nYou'll find:\n" > ${SNAPSHOT_README}
+
+  echo -e "<html>" \
+          "\n\n<head>" \
+          "\n<title>GCC "${RELEASE}" Snapshot</title>" \
+          "\n</head>" \
+          "\n\n<body>" \
+          "\n<h1>GCC "${RELEASE}" Snapshot</h1>" \
+          "\n\n<p>The <a href =\"http://gcc.gnu.org/\">GCC Project</a> makes" \
+          "\nperiodic snapshots of the GCC source tree available to the public" \
+          "\nfor testing purposes.</p>" \
+          "\n\n<p>If you are planning to download and use one of our snapshots, then" \
+          "\nwe highly recommend you join the GCC developers list.  Details for" \
+          "\nhow to sign up can be found on the GCC project home page.</p>" \
+          "\n\n<p>This snapshot has been generated from the GCC "${BRANCH}" CVS branch" \
+          "\nwith the following options: <code>"${EXPORTTAG} ${EXPORTDATE}"</code></p>" \
+          "\n\n<table>" > ${SNAPSHOT_INDEX}
+       
+  SNAP_FILE=gcc-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="Complete GCC (includes all of below)"
+  snapshot_print
+
+  SNAP_FILE=gcc-core-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="C front end and core compiler"
+  snapshot_print
+
+  SNAP_FILE=gcc-ada-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="Ada front end and runtime"
+  snapshot_print
+
+  SNAP_FILE=gcc-fortran-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="Fortran front end and runtime"
+  snapshot_print
+
+  SNAP_FILE=gcc-g++-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="C++ front end and runtime"
+  snapshot_print
+
+  SNAP_FILE=gcc-g77-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="Fortran 77 front end and runtime"
+  snapshot_print
+
+  SNAP_FILE=gcc-java-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="Objective-C front end and runtime"
+  snapshot_print
+
+  SNAP_FILE=gcc-objc-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="Java front end and runtime"
+  snapshot_print
+
+  SNAP_FILE=gcc-testsuite-${RELEASE}.tar.bz2
+  SNAP_DESCRIPTION="The GCC testsuite"
+  snapshot_print
+
+  echo -e "\nDiffs from "${BRANCH}"-"${LAST_DATE}" are available in the diffs/ subdirectory." \
+          "\n\nWhen a particular snapshot is ready for public consumption the LATEST-"${BRANCH} \
+          "\nlink is updated and a message is sent to the gcc list.  Please do not use" \
+          "\na snapshot before it has been announced that way." >> ${SNAPSHOT_README}
+
+  echo -e "</table>" \
+          "\n<p>Diffs from "${BRANCH}"-"${LAST_DATE}" are available in the" \
+          "\n<a href=\"diffs/\">diffs/ subdirectory</a>.</p>" \
+          "\n\n<p>When a particular snapshot is ready for public consumption the LATEST-"${BRANCH} \
+          "\nlink is updated and a message is sent to the gcc list.  Please do not use" \
+          "\na snapshot before it has been announced that way.</p>" \
+          "\n\n<hr />" \
+          "\n\n<address>" \
+          "\n<a href=\"mailto:gcc@gcc.gnu.org\">gcc@gcc.gnu.org</a>" \
+          "\n<br />" \
+          "\nLast modified "${TEXT_DATE} \
+          "\n</address>" \
+          "\n</body>" \
+          "\n\n</html>" >> ${SNAPSHOT_INDEX}
+
+  rm -f LATEST-${BRANCH}
+  ln -s ${RELEASE} LATEST-${BRANCH}
 
   inform "Sending mail"
 
   export QMAILHOST=gcc.gnu.org
-  mail -s "gcc-ss-${RELEASE} is now available" gcc@gcc.gnu.org < ${SNAPSHOTS_DIR}/${RELEASE}/README
+  mail -s "gcc-${RELEASE} is now available" gcc@gcc.gnu.org < ${SNAPSHOT_README}
 }
 
 ########################################################################
@@ -486,6 +578,7 @@ SOURCE_DIRECTORY=""
 ADA_DIRS="gcc/ada libada"
 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"
 TESTSUITE_DIRS="gcc/testsuite"
@@ -515,7 +608,7 @@ FILE_LIST=""
 
 BZIP2="${BZIP2:-bzip2}"
 CVS="${CVS:-cvs -f -Q -z9}"
-DIFF="${DIFF:-diff -Nrc3pad}"
+DIFF="${DIFF:-diff -Nrcpad}"
 ENV="${ENV:-env}"
 GZIP="${GZIP:-gzip --best}"
 SCP="${SCP:-scp -p}"
@@ -635,6 +728,7 @@ SOURCE_DIRECTORY="${WORKING_DIRECTORY}/gcc-${RELEASE}"
 ADA_DIRS=`adjust_dirs ${ADA_DIRS}`
 CPLUSPLUS_DIRS=`adjust_dirs ${CPLUSPLUS_DIRS}`
 FORTRAN_DIRS=`adjust_dirs ${FORTRAN_DIRS}`
+FORTRAN95_DIRS=`adjust_dirs ${FORTRAN95_DIRS}`
 JAVA_DIRS=`adjust_dirs ${JAVA_DIRS}`
 OBJECTIVEC_DIRS=`adjust_dirs ${OBJECTIVEC_DIRS}`
 TESTSUITE_DIRS=`adjust_dirs ${TESTSUITE_DIRS}`