[m-rev.] diff: split up ftp beta-releases directory

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jan 17 19:38:29 AEDT 2003


The ftp site was becoming a mess, with a zillion files in the
same directory.  So I split it up.

Estimated hours taken: 1
Branches: main

tools/test_mercury:
	Split the ftp beta-releases directory into separate
	sub-directories for each version.

Workspace: /home/ceres/fjh/mercury
Index: tools/test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.230
diff -u -d -r1.230 test_mercury
--- tools/test_mercury	17 Jan 2003 07:51:24 -0000	1.230
+++ tools/test_mercury	17 Jan 2003 08:28:41 -0000
@@ -116,6 +116,11 @@
 # (Not the full path, just the final directory name.)
 # More generally used for naming stuff related to this branch.
 #
+# FTP_DIR_NAME:
+# The name of the directory in which to put the source & binary
+# distributions for this branch, on the ftp and web sites.
+# (Not the full path, just the final directory name.)
+#
 # CHECKOUT_OPTS:
 # Options to pass to cvs checkout.
 #
@@ -142,26 +147,38 @@
 	latest)
 		CHECKOUT_OPTS=-A
 		BASE_TAG_NAME=rotd
+		FTP_DIR_NAME=rotd
 		RELEASE_VERSION=rotd-$DATE
 		RELEASE_VERSION_PATTERN=rotd-*
 		;;
 	0.11)
 		CHECKOUT_OPTS=-rversion-0_11-branch
 		BASE_TAG_NAME=version-0_11-branch
+		FTP_DIR_NAME=0.11.1-beta
 		RELEASE_VERSION=0.11.1-beta-$DATE
 		RELEASE_VERSION_PATTERN=0.11.1-beta-*
+
+		# This is for release 0.11.0 itself
+		# (as opposed to beta releases).
 		#CHECKOUT_OPTS=-rversion-0_11_0
 		#BASE_TAG_NAME=version-0_11_0
+		#FTP_DIR_NAME=0.11.0
 		#RELEASE_VERSION=0.11.0
 		#RELEASE_VERSION_PATTERN=0.11.0*
 		;;
 	0.10)
 		CHECKOUT_OPTS=-rversion-0_10_y
-		#CHECKOUT_OPTS=-rversion-0_10_2
+		FTP_DIR_NAME=0.10.2-beta
 		BASE_TAG_NAME=version-0_10_y
 		RELEASE_VERSION=0.10.2-beta-$DATE
-		#RELEASE_VERSION=0.10.2
 		RELEASE_VERSION_PATTERN=0.10.2-beta-*
+
+		# This is for release 0.10.2 itself
+		# (as opposed to beta releases).
+		#CHECKOUT_OPTS=-rversion-0_10_2
+		#BASE_TAG_NAME=version-0_10_y
+		#RELEASE_VERSION=0.10.2
+		#RELEASE_VERSION_PATTERN=0.10.2
 		;;
 esac
 case "$C_COMPILER" in
@@ -280,7 +297,7 @@
 esac
 
 BETA_FTPHOST=ftp.mercury.cs.mu.oz.au
-BETA_FTPDIR=/home/ftp/pub/mercury/beta-releases
+BETA_FTPDIR=/home/ftp/pub/mercury/beta-releases/$FTP_DIR_NAME
 BETA_WEBDIR=/home/mercury5/installed_w3/download/files/beta-releases
 BETA_WEBDIR_TOP=/home/mercury5/installed_w3/download/files
 
@@ -978,16 +995,15 @@
 	else 
 		rm -f $UNSTABLE/mercury-test-failures-$version-unstable.txt
 	fi &&
-	ssh $BETA_FTPHOST \
-		"rm -f $BETA_FTPDIR/mercury-compiler-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
-	ssh $BETA_FTPHOST \
-		"rm -f $BETA_FTPDIR/mercury-extras-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
-	ssh $BETA_FTPHOST \
-		"rm -f $BETA_FTPDIR/mercury-tests-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
-	ssh $BETA_FTPHOST \
-		"rm -f $BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN-unstable.txt" &&
+	ssh $BETA_FTPHOST "\
+	    [ -d $BETA_FTPDIR ] || mkdir $BETA_FTPDIR
+	    rm -f \
+		$BETA_FTPDIR/mercury-compiler-$RELEASE_VERSION_PATTERN-unstable.tar.gz \
+		$BETA_FTPDIR/mercury-extras-$RELEASE_VERSION_PATTERN-unstable.tar.gz \
+		$BETA_FTPDIR/mercury-tests-$RELEASE_VERSION_PATTERN-unstable.tar.gz \
+		$BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN-unstable.txt" &&
 	scp $UNSTABLE/mercury-*-$version-unstable.* \
-		$BETA_FTPHOST:$BETA_FTPDIR  &&
+		$BETA_FTPHOST:$BETA_FTPDIR &&
 	rm -f $BETA_WEBDIR/mercury-compiler-$RELEASE_VERSION_PATTERN-unstable.tar.gz &&
 	rm -f $BETA_WEBDIR/mercury-extras-$RELEASE_VERSION_PATTERN-unstable.tar.gz &&
 	rm -f $BETA_WEBDIR/mercury-tests-$RELEASE_VERSION_PATTERN-unstable.tar.gz &&
@@ -996,8 +1012,10 @@
 	;;
 esac
 case $HOST in $GCC_ROTD_HOST)
-	ssh $BETA_FTPHOST \
-		"rm -f $BETA_FTPDIR/mercury-gcc-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
+	ssh $BETA_FTPHOST "\
+	  [ -d $BETA_FTPDIR ] || mkdir $BETA_FTPDIR
+	  rm -f \
+	    $BETA_FTPDIR/mercury-gcc-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
 	scp $UNSTABLE/mercury-gcc-$version.tar.gz \
 	    $BETA_FTPHOST:$BETA_FTPDIR/mercury-gcc-$version-unstable.tar.gz  &&
 	rm -f $BETA_WEBDIR/mercury-gcc-$RELEASE_VERSION_PATTERN-unstable.tar.gz &&
@@ -1131,7 +1149,9 @@
 		$STABLE/mercury-NEWS-$version.$fullname.txt &&
 	$LN $UNSTABLE/mercury-INSTALL-$version.$fullname.txt \
 		$STABLE/mercury-INSTALL-$version.$fullname.txt &&
-	ssh $BETA_FTPHOST "rm -f \
+	ssh $BETA_FTPHOST "\
+	    [ -d $BETA_FTPDIR ] || mkdir $BETA_FTPDIR
+	    rm -f \
 		$BETA_FTPDIR/mercury-$RELEASE_VERSION_PATTERN.$fullname.tar.gz \
 		$BETA_FTPDIR/mercury*-$RELEASE_VERSION_PATTERN.$fullname.txt" &&
 	scp $STABLE/mercury*-$version.$fullname.* $BETA_FTPHOST:$BETA_FTPDIR &&
@@ -1189,10 +1209,11 @@
 	        $STABLE/mercury-INSTALL-$version.txt &&
 
 	    ssh $BETA_FTPHOST "\
-	    rm -f $BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN[0-9].tar.gz && 
-	    rm -f $BETA_FTPDIR/mercury-*-$version.tar.gz && 
-	    rm -f $BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN[0-9].txt && 
-	    rm -f $BETA_FTPDIR/mercury-*-$version.txt && 
+	    [ -d $BETA_FTPDIR ] || mkdir $BETA_FTPDIR
+	    rm -f $BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN[0-9].tar.gz \
+	          $BETA_FTPDIR/mercury-*-$version.tar.gz \
+	          $BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN[0-9].txt \
+	          $BETA_FTPDIR/mercury-*-$version.txt && 
 	    $LN $BETA_FTPDIR/mercury-compiler-$version-unstable.tar.gz \
 	        $BETA_FTPDIR/mercury-compiler-$version.tar.gz &&
 	    $LN $BETA_FTPDIR/mercury-extras-$version-unstable.tar.gz \
@@ -1229,8 +1250,9 @@
 	        $STABLE/mercury-gcc-$version.tar.gz &&
 
 	    ssh $BETA_FTPHOST "\
-	    rm -f $BETA_FTPDIR/mercury-gcc-$RELEASE_VERSION_PATTERN[0-9].tar.gz && 
-	    rm -f $BETA_FTPDIR/mercury-gcc-$version.tar.gz && 
+	    [ -d $BETA_FTPDIR ] || mkdir $BETA_FTPDIR
+	    rm -f $BETA_FTPDIR/mercury-gcc-$RELEASE_VERSION_PATTERN[0-9].tar.gz \
+		  $BETA_FTPDIR/mercury-gcc-$version.tar.gz && 
 	    $LN $BETA_FTPDIR/mercury-gcc-$version-unstable.tar.gz \
 	        $BETA_FTPDIR/mercury-gcc-$version.tar.gz" &&
 
@@ -1263,6 +1285,7 @@
 rsh $BETA_FTPHOST "\
 	PATH=/home/mercury/public/cron/scripts:\$PATH &&
 	export PATH &&
+	( [ -d $BETA_FTPDIR ] || mkdir $BETA_FTPDIR ) &&
 	cd $BETA_FTPDIR &&
 	generate_index_html" || set_status "generating ftp index"
 echo "test_mercury generating ftp index files, finished at `date`" 1>&2

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list