From b348a598a808ac5ad34eb3b7bb518d9af32d0f91 Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Wed, 25 Jun 2003 11:36:19 +0200 Subject: [PATCH] gcc_release: Factor the updating of links and READMEs on the FTP server and sending mail for... * gcc_release: Factor the updating of links and READMEs on the FTP server and sending mail for snapshots into a... (announce_snapshot): ...new function. Add informative output for both. From-SVN: r68473 --- maintainer-scripts/ChangeLog | 7 ++++++ maintainer-scripts/gcc_release | 44 +++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog index 6f8132c5b49..f897e22db2d 100644 --- a/maintainer-scripts/ChangeLog +++ b/maintainer-scripts/ChangeLog @@ -1,3 +1,10 @@ +2003-06-25 Gerald Pfeifer + + * gcc_release: Factor the updating of links and READMEs on the + FTP server and sending mail for snapshots into a... + (announce_snapshot): ...new function. + Add informative output for both. + 2003-06-18 Gerald Pfeifer * gcc_release: Do not update gcc_latest_snapshot tag any longer. diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release index 5c714f58384..41fb7fe7c08 100755 --- a/maintainer-scripts/gcc_release +++ b/maintainer-scripts/gcc_release @@ -336,7 +336,6 @@ build_diff() { } # Upload the files to the FTP server. - upload_files() { inform "Uploading files" @@ -372,6 +371,30 @@ upload_files() { done } +# 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` + cd ~ftp/pub/gcc/snapshots + sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \ + -e "s%@LONG_DATE@%$LONG_DATE%g" \ + -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-README > $$ + mv $$ README + sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \ + -e "s%@LONG_DATE@%$LONG_DATE%g" \ + -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-index.html > $$ + mv $$ index.html + + touch LATEST-IS-$LONG_DATE + rm -f LATEST-IS-$LAST_LONG_DATE + + inform "Sending mail" + + export QMAILHOST=gcc.gnu.org + mail -s "gcc-ss-$DATE is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README +} + ######################################################################## # Initialization ######################################################################## @@ -629,29 +652,12 @@ if [ $MODE_UPLOAD -ne 0 ]; then # For snapshots, make some further updates. if [ $SNAPSHOT -ne 0 ] && [ $LOCAL -ne 0 ]; then - # Update links on the FTP server. - TEXT_DATE=`date --date=$DATE +%B\ %d,\ %Y` - cd ~ftp/pub/gcc/snapshots - sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \ - -e "s%@LONG_DATE@%$LONG_DATE%g" \ - -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-README > $$ - mv $$ README - sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \ - -e "s%@LONG_DATE@%$LONG_DATE%g" \ - -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-index.html > $$ - mv $$ index.html - - touch LATEST-IS-$LONG_DATE - rm -f LATEST-IS-$LAST_LONG_DATE + announce_snapshot # Update snapshot date file. changedir ~ echo $DATE >.snapshot_date - # Announce the snapshot. - export QMAILHOST=gcc.gnu.org - mail -s "gcc-ss-$DATE is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README - # Remove working directory rm -rf ${WORKING_DIRECTORY} fi -- 2.30.2