+#Print description if snapshot exists
+snapshot_print() {
+ if [ -e ${RELEASE}/$1 ]; then
+ printf "%-38s%s\n\n" "$1" "$2" >> ${SNAPSHOT_README}
+ echo " <tr><td><a href=\"$1\">$1</a></td>" >> ${SNAPSHOT_INDEX}
+ echo " <td>$2</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}"
+ echo \
+"Snapshot gcc-"${RELEASE}" is now available on
+ ftp://gcc.gnu.org/pub/gcc/snapshots/"${RELEASE}"/
+and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
+
+This snapshot has been generated from the GCC "${BRANCH}" CVS branch
+with the following options: "${EXPORTTAG} ${EXPORTDATE}"
+
+You'll find:
+" > ${SNAPSHOT_README}
+
+ echo \
+"<html>
+
+<head>
+<title>GCC "${RELEASE}" Snapshot</title>
+</head>
+
+<body>
+<h1>GCC "${RELEASE}" Snapshot</h1>
+
+<p>The <a href =\"http://gcc.gnu.org/\">GCC Project</a> makes
+periodic snapshots of the GCC source tree available to the public
+for testing purposes.</p>
+
+<p>If you are planning to download and use one of our snapshots, then
+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}" CVS branch
+with the following options: <code>"${EXPORTTAG} ${EXPORTDATE}"</code></p>
+
+<table>" > ${SNAPSHOT_INDEX}
+
+ snapshot_print gcc-${RELEASE}.tar.bz2 "Complete GCC (includes all of below)"
+ snapshot_print gcc-core-${RELEASE}.tar.bz2 "C front end and core compiler"
+ snapshot_print gcc-ada-${RELEASE}.tar.bz2 "Ada front end and runtime"
+ snapshot_print gcc-fortran-${RELEASE}.tar.bz2 "Fortran front end and runtime"
+ snapshot_print gcc-g++-${RELEASE}.tar.bz2 "C++ front end and runtime"
+ snapshot_print gcc-g77-${RELEASE}.tar.bz2 "Fortran 77 front end and runtime"
+ snapshot_print gcc-java-${RELEASE}.tar.bz2 "Java front end and runtime"
+ snapshot_print gcc-objc-${RELEASE}.tar.bz2 "Objective-C front end and runtime"
+ snapshot_print gcc-testsuite-${RELEASE}.tar.bz2 "The GCC testsuite"
+
+ echo \
+"Diffs from "${BRANCH}"-"${LAST_DATE}" are available in the diffs/ subdirectory.
+
+When a particular snapshot is ready for public consumption the LATEST-"${BRANCH}"
+link is updated and a message is sent to the gcc list. Please do not use
+a snapshot before it has been announced that way." >> ${SNAPSHOT_README}
+
+ echo \
+"</table>
+<p>Diffs from "${BRANCH}"-"${LAST_DATE}" are available in the
+<a href=\"diffs/\">diffs/ subdirectory</a>.</p>
+
+<p>When a particular snapshot is ready for public consumption the LATEST-"${BRANCH}"
+link is updated and a message is sent to the gcc list. Please do not use
+a snapshot before it has been announced that way.</p>
+
+<hr />
+
+<address>
+<a href=\"mailto:gcc@gcc.gnu.org\">gcc@gcc.gnu.org</a>
+<br />
+Last modified "${TEXT_DATE}"
+</address>
+</body>
+
+</html>" >> ${SNAPSHOT_INDEX}
+
+ rm -f LATEST-${BRANCH}
+ ln -s ${RELEASE} LATEST-${BRANCH}
+
+ inform "Sending mail"
+
+ export QMAILHOST=gcc.gnu.org
+ mail -s "gcc-${RELEASE} is now available" gcc@gcc.gnu.org < ${SNAPSHOT_README}
+}
+