OSDN Git Service

2004-08-03 Kelley Cook <kcook@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / maintainer-scripts / gcc_release
index dec063b..8d49ce9 100755 (executable)
@@ -248,6 +248,7 @@ 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 "MD5SUMS" file to use for checking the validity of the release.
   find . -type f |sed -e 's:^\./::' -e '/MD5SUMS/d' |sort |xargs md5sum >MD5SUMS
@@ -256,7 +257,7 @@ EOF
 # 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.
@@ -269,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() {
@@ -286,13 +306,13 @@ 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-fortran-${RELEASE} ${FORTRAN95_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=""
@@ -387,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}
 }
 
 ########################################################################