[m-rev.] for review: more improvements for download page

Simon Taylor stayl at cs.mu.OZ.AU
Wed Aug 28 17:51:16 AEST 2002


Estimated hours taken: 2

More improvements for the web site download page.

tools/test_mercury:
	Install the NEWS, INSTALL, bindist.INSTALL and test failure
	logs in the ftp and web distribution directories.

	Make sure all problems which cause the tests to fail cause a
	line prefixed with '**' in the error log.

tools/generate_index_html:
	Change the names of the NEWS and INSTALL to match the names
	which are actually installed.

	Follow symlinks when working out the size of files.


Index: generate_index_html
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/generate_index_html,v
retrieving revision 1.6
diff -u -u -r1.6 generate_index_html
--- generate_index_html	19 Aug 2002 09:18:39 -0000	1.6
+++ generate_index_html	28 Aug 2002 07:25:48 -0000
@@ -46,7 +46,7 @@
 	prefix=$1
 	this_file=$2
 	this_file_descr=$3
-	this_file_size=`ls -l $this_file | awk '{ print $5; }'`
+	this_file_size=`ls -Ll $this_file | awk '{ print $5; }'`
 	this_file_sizekb=`expr $this_file_size / 1024`
 	handled_files="$this_file $handled_files"
 	echo "$prefix <a href=$this_file>$this_file_descr</a> ($this_file_sizekb kilobytes)" >> $INDEX 
@@ -121,8 +121,10 @@
 
 	echo "<li> $release_name" >> $INDEX
 	echo '<ul>' >> $INDEX
-	link_to_existing_file NEWS-$release_id "NEWS"
-	link_to_existing_file INSTALL-$release_id "Installation instructions"
+	source_dist_news="mercury-NEWS-$release_id.txt"
+	link_to_existing_file "$source_dist_news" "News"
+	link_to_existing_file mercury-INSTALL-$release_id.txt \
+		"Installation instructions"
 	link_to_existing_file mercury-compiler-$release_id.tar.gz \
 		"Source distribution"
 	link_to_existing_file mercury-compiler-$release_id-1.src.rpm \
@@ -139,16 +141,43 @@
 		echo "<ul>" >> $INDEX
 		for bindist in $bindists
 		do
-			bindist_name=`echo $bindist | \
-			    sed -e"s/mercury-$release_id.\(.*\).tar.gz/\1/"`
-			link_to_file "<li> " $bindist $bindist_name	
+		    bindist_name=`expr \
+		    	"$bindist" : "mercury-$release_id.\(.*\).tar.gz"`
+		    link_to_file "<li> " $bindist $bindist_name
+		    echo "<ul>" >> $INDEX
+		    bindist_news="mercury-NEWS-$release_id.txt"
+
+		    # If the news file for the source distribution
+		    # doesn't exist, or doesn't match the news file for
+		    # the binary distribution, generate a link to the
+		    # news file for the binary distribution.
+		    # XXX We should probably generate a separate release
+		    # entry if the news files for the source and binary
+		    # distributions don't match, but that should be rare.
+		    if cmp $bindist_news $source_dist_news >& /dev/null
+		    then
+		    	:
+		    else
+			link_to_existing_file \
+			    mercury-NEWS-$release_id.$bindist_name.txt \
+			    "News"
+		    fi
+
+		    link_to_existing_file \
+			mercury-INSTALL-$release_id.$bindist_name.txt \
+			"Installation instructions"
+		    link_to_existing_file \
+			mercury-test-failures-$release_id.$bindist_name.txt \
+			"Test failures"
+		    echo "</ul>" >> $INDEX
 		done
 		echo "</ul>" >> $INDEX
 		;;
 	esac
 	link_to_existing_file mercury-extras-$release_id.tar.gz "Extras"
 	link_to_existing_file mercury-tests-$release_id.tar.gz "Test suite"
-	link_to_existing_file test-failures-$release_id "Test failures"
+	link_to_existing_file mercury-test-failures-$release_id.txt \
+		"Test failures"
 	echo '</ul><p>' >> $INDEX
 }
 
Index: test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.187
diff -u -u -r1.187 test_mercury
--- test_mercury	26 Aug 2002 06:23:13 -0000	1.187
+++ test_mercury	28 Aug 2002 07:50:07 -0000
@@ -50,6 +50,11 @@
 # Host to use to build the release of the day.
 ROTD_HOST=earth
 
+set_status () {
+	status=1;
+	echo '**' Error in $*
+}
+
 #-----------------------------------------------------------------------------#
 
 #
@@ -109,9 +114,12 @@
 		;;
 esac
 case "$C_COMPILER" in
-	gcc)	TEST_ID=$BRANCH.$HOST ;;
-	*)	TEST_ID=$BRANCH.$HOST."$C_COMPILER" ;;
+	gcc)	TEST_ID=$BRANCH.$HOST
+        	TEST_ERROR_FILE="$TESTDIR/logs/test-$BRANCH-$HOST.test_errs" ;;
+	*)	TEST_ID=$BRANCH.$HOST."$C_COMPILER
+		TEST_ERROR_FILE="$TESTDIR/logs/test-$BRANCH-$HOST-$C_COMPILER.test_errs" ;;
 esac
+rm -f $TEST_ERROR_FILE
 
 #-----------------------------------------------------------------------------#
 
@@ -480,7 +488,7 @@
 		(cd gcc && 
 			contrib/gcc_update --touch &&
 			sh configure --enable-languages=mercury &&
-			make) || status=1
+			make) || set_status "gcc checkout"
 		date
 		;;
 esac
@@ -588,14 +596,17 @@
     # Note that we don't pass $target_opts when doing `mmake install_grades';
     # that wouldn't work, since many of the grades can only be built with
     # `--target c'.
-    mmake $target_opts install_main MMAKEFLAGS=$PARALLEL || status=1
-    mmake install_grades MMAKEFLAGS=$PARALLEL || status=1
+    mmake $target_opts install_main MMAKEFLAGS=$PARALLEL || \
+    		set_status "install_main"
+    mmake install_grades MMAKEFLAGS=$PARALLEL || \
+    		set_status "install_grades"
     case "$INSTALL_GRADE" in
 	hl*)
 	    	# --split-c-files is not supported for the hl* grades
 	    	;;
 	*)	mmake install_split_library \
-			LIBGRADES= MMAKEFLAGS=$PARALLEL || status=1
+			LIBGRADES= MMAKEFLAGS=$PARALLEL || \
+    			set_status "install_split_library"
 		;;
     esac
 
@@ -603,15 +614,16 @@
 	# do it here.  Any grade which is tested later, but which is not
 	# installed above, should be installed here.
     case $HOST in
-    	hg)	mmake install_grades LIBGRADES="asm_fast.par.gc" || status=1
+    	hg)	mmake install_grades LIBGRADES="asm_fast.par.gc" || \
+    			set_status "install asm_fast.par.gc"
 		;;
 	*)
 		;;
     esac
 
     case $install_anyway in
-        false)	cd ../.. || status=1 ;;
-        true)	cd .. || status=1 ;;
+        false)	cd ../.. || set_status "cd ../.." ;;
+        true)	cd .. || set_status "cd .." ;;
     esac
 
     [ -d $TESTDIR/logs ] || mkdir -p $TESTDIR/logs
@@ -676,7 +688,7 @@
 			mmake install LIBGRADES= \
 					$PARALLEL MMAKEFLAGS=$PARALLEL &&
 			mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL) ||
-				status=1
+				set_status "clpr realclean"
 		echo "test trailed_update stuff for grade $grade" 1>&2
 		(cd mercury/extras/trailed_update &&
 			mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL &&
@@ -684,7 +696,7 @@
 			mmake 		 $PARALLEL MMAKEFLAGS=$PARALLEL &&
 			mmake check	 $PARALLEL MMAKEFLAGS=$PARALLEL &&
 			mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL) ||
-				status=1
+			    set_status "trailed_update realclean"
 	fi
 done
 
@@ -716,13 +728,15 @@
 	mmake MMAKEFLAGS="EXTRA_MCFLAGS='-O5 --opt-space' $PARALLEL" tar &&
 	cd .. &&
 	rm -f $UNSTABLE/* &&
+	cp mercury/NEWS $UNSTABLE/mercury-NEWS-$version-unstable.txt &&
+	cp mercury/INSTALL $UNSTABLE/mercury-INSTALL-$version-unstable.txt &&
 	mv mercury-compiler-$version.tar.gz	\
 	    $UNSTABLE/mercury-compiler-$version-unstable.tar.gz &&
 	mv mercury-extras-$version.tar.gz	\
 	    $UNSTABLE/mercury-extras-$version-unstable.tar.gz &&
 	mv mercury-tests-$version.tar.gz	\
 	    $UNSTABLE/mercury-tests-$version-unstable.tar.gz
-	} || status=1
+	} || set_status "making source distribution"
 	# later parts of this script assume that we've already run configure,
 	# so we need to redo that
 	cd $DIR/mercury && sh configure --prefix=$INSTALL_DIR
@@ -853,12 +867,6 @@
 # 	*) ;;
 # esac
 
-case "$C_COMPILER" in
-        gcc) test_error_file="$TESTDIR/logs/test-$BRANCH-$HOST.test_errs" ;;
-        *)   test_error_file=\
-		"$TESTDIR/logs/test-$BRANCH-$HOST-$C_COMPILER.test_errs" ;;
-esac
-rm -f $test_error_file
 for grade in $GRADES
 do
 	echo "test_mercury starting tests for grade $grade at `date`" 1>&2
@@ -867,9 +875,9 @@
 		EXTRA_CFLAGS="$TEST_CFLAGS" \
 		EXTRA_MGNUCFLAGS="$TEST_MGNUCFLAGS" \
 		EXTRA_MLFLAGS="$TEST_MLFLAGS" \
-		$PARALLEL runtests || status=1
+		$PARALLEL runtests || set_status "tests in grade $grade"
 	if [ -f runtests.errs ]; then
-		cat runtest.errs >> $test_error_file
+		cat runtest.errs >> $TEST_ERROR_FILE
 	fi
 	case $grade in
 		*.memprof*)
@@ -903,7 +911,8 @@
 			cp Prof.CallPair poly.$grade.CallPair &&
 			cp Prof.MemoryWords poly.$grade.MemoryWords &&
 			cp Prof.MemoryCells poly.$grade.MemoryCells &&
-			cp Prof.Decl poly.$grade.Decl) || status=1
+			cp Prof.Decl poly.$grade.Decl) ||
+			set_status "benchmarks/poly in grade *.memprof*
 			;;
 	esac
 done
@@ -919,7 +928,7 @@
 		EXTRA_MLFLAGS="$TEST_MLFLAGS" \
 		$PARALLEL runtests
 	if [ -f runtests.errs ]; then
-		cat runtest.errs >> $test_error_file
+		cat runtest.errs >> $TEST_ERROR_FILE
 	fi
 	;;
 esac
@@ -931,19 +940,27 @@
 : update the unstable release
 
 case $HOST in $ROTD_HOST)
+	if [ -s $TEST_ERROR_FILE ]; then
+		cp $TEST_ERROR_FILE \
+			$UNSTABLE/mercury-test-failures-$version-unstable.txt
+	else 
+		rm -f $UNSTABLE/mercury-test-failures-$version-unstable.txt
+	fi &&
 	rsh $BETA_FTPHOST \
 		"rm -f $BETA_FTPDIR/mercury-compiler-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
 	rsh $BETA_FTPHOST \
 		"rm -f $BETA_FTPDIR/mercury-extras-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
 	rsh $BETA_FTPHOST \
 		"rm -f $BETA_FTPDIR/mercury-tests-$RELEASE_VERSION_PATTERN-unstable.tar.gz" &&
-	rcp $UNSTABLE/mercury-*-$version-unstable.tar.gz \
-		$BETA_FTPHOST:$BETA_FTPDIR 
+	rsh $BETA_FTPHOST \
+		"rm -f $BETA_FTPDIR/mercury-*-$RELEASE_VERSION_PATTERN-unstable.txt" &&
+	rcp $UNSTABLE/mercury-*-$version-unstable.* \
+		$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 &&
-	cp $UNSTABLE/mercury-*-$version-unstable.tar.gz \
-		$BETA_WEBDIR
+	rm -f $BETA_WEBDIR/mercury-*-$RELEASE_VERSION_PATTERN-unstable.txt &&
+	cp $UNSTABLE/mercury-*-$version-unstable.* $BETA_WEBDIR
 	;;
 esac
 
@@ -1019,6 +1036,16 @@
 	cd .. &&
 	{ [ -d $UNSTABLE ] || mkdir $UNSTABLE; } &&
 	rm -f $UNSTABLE/mercury-*.$fullname.tar.gz &&
+	rm -f $UNSTABLE/mercury-*.$fullname.txt &&
+	cp mercury/NEWS $UNSTABLE/mercury-NEWS-$version.$fullname.txt &&
+	cp mercury/bindist/bindist.INSTALL \
+		$UNSTABLE/mercury-INSTALL-$version.$fullname.txt &&
+	if [ -s $TEST_ERROR_FILE ]; then
+		cp $TEST_ERROR_FILE \
+			$UNSTABLE/mercury-test-failures-$version.$fullname.txt
+	else 
+		rm $UNSTABLE/mercury-test-failures-$version.$fullname.txt
+	fi &&
 	mv mercury/mercury-$version.$fullarch.tar.gz \
 		$UNSTABLE/mercury-$version.$fullname.tar.gz &&
 	:
@@ -1026,23 +1053,29 @@
 	cvs rtag -d unstable-$BASE_TAG_NAME-$fullname_tag mercury clpr tests &&
 	cvs tag unstable-$BASE_TAG_NAME-$fullname_tag mercury tests &&
 	echo "test_mercury tagging unstable $BASE_TAG_NAME, finished at `date`" 1>&2
-} || status=1
+} || set_status "creating binary distribution"
 
 case $status in
     0) {
     	cd $DIR &&
 	{ [ -d $STABLE ] || mkdir $STABLE; } &&
-	rm -f $STABLE/mercury-$RELEASE_VERSION_PATTERN.$fullname.tar.gz &&
+	rm -f $STABLE/mercury*-$RELEASE_VERSION_PATTERN.$fullname.tar.gz &&
+	rm -f $STABLE/mercury*-$RELEASE_VERSION_PATTERN.$fullname.txt &&
 	$LN $UNSTABLE/mercury-$version.$fullname.tar.gz \
 		$STABLE/mercury-$version.$fullname.tar.gz &&
-	rsh $BETA_FTPHOST "rm -f $BETA_FTPDIR/mercury-$RELEASE_VERSION_PATTERN.$fullname.tar.gz" &&
-	rcp $STABLE/mercury-$version.$fullname.tar.gz \
-		$BETA_FTPHOST:$BETA_FTPDIR &&
+	$LN $UNSTABLE/mercury-NEWS-$version.$fullname.txt \
+		$STABLE/mercury-NEWS-$version.$fullname.txt &&
+	$LN $UNSTABLE/mercury-INSTALL-$version.$fullname.txt \
+		$STABLE/mercury-INSTALL-$version.$fullname.txt &&
+	rsh $BETA_FTPHOST "rm -f \
+		$BETA_FTPDIR/mercury-$RELEASE_VERSION_PATTERN.$fullname.tar.gz \
+		$BETA_FTPDIR/mercury-$RELEASE_VERSION_PATTERN.$fullname.txt" &&
+	rcp $STABLE/mercury*-$version.$fullname.* $BETA_FTPHOST:$BETA_FTPDIR &&
 	echo "test_mercury tagging stable $BASE_TAG_NAME, starting at `date`" 1>&2 &&
 	cvs rtag -d stable-$BASE_TAG_NAME-$fullname_tag mercury clpr tests &&
 	cvs tag stable-$BASE_TAG_NAME-$fullname_tag mercury tests &&
 	echo "test_mercury tagging stable $BASE_TAG_NAME, finished at `date`" 1>&2
-       } || status=1
+       } || set_status "copying binary distribution"
     ;;
 esac
 
@@ -1058,23 +1091,35 @@
 	    cd $DIR &&
 		# Delete older stable versions that this one replaces
 	    rm -f $STABLE/mercury-*-$RELEASE_VERSION_PATTERN[0-9].tar.gz &&
+	    rm -f $STABLE/mercury-*-$RELEASE_VERSION_PATTERN[0-9].txt &&
 	    rm -f $STABLE/mercury-*-$version.tar.gz &&
+	    rm -f $STABLE/mercury-*-$version.txt &&
 	    $LN $UNSTABLE/mercury-compiler-$version-unstable.tar.gz \
 	        $STABLE/mercury-compiler-$version.tar.gz &&
 	    $LN $UNSTABLE/mercury-extras-$version-unstable.tar.gz \
 	        $STABLE/mercury-extras-$version.tar.gz &&
 	    $LN $UNSTABLE/mercury-tests-$version-unstable.tar.gz \
 	        $STABLE/mercury-tests-$version.tar.gz &&
+	    $LN $UNSTABLE/mercury-NEWS-$version-unstable.txt \
+	        $STABLE/mercury-NEWS-$version.txt &&
+	    $LN $UNSTABLE/mercury-INSTALL-$version-unstable.txt \
+	        $STABLE/mercury-INSTALL-$version.txt &&
 
 	    rsh $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 && 
 	    $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 \
 	        $BETA_FTPDIR/mercury-extras-$version.tar.gz &&
 	    $LN $BETA_FTPDIR/mercury-tests-$version-unstable.tar.gz \
-	        $BETA_FTPDIR/mercury-tests-$version.tar.gz" &&
+	        $BETA_FTPDIR/mercury-tests-$version.tar.gz &&
+	    $LN $BETA_FTPDIR/mercury-NEWS-$version-unstable.txt \
+	        $BETA_FTPDIR/mercury-NEWS-$version.txt &&
+	    $LN $BETA_FTPDIR/mercury-INSTALL-$version-unstable.txt \
+	        $BETA_FTPDIR/mercury-INSTALL-$version.txt" &&
 
 	    rm -f $BETA_WEBDIR/mercury-compiler-$RELEASE_VERSION_PATTERN[0-9].tar.gz &&
 	    rm -f $BETA_WEBDIR/mercury-extras-$RELEASE_VERSION_PATTERN[0-9].tar.gz &&
@@ -1084,9 +1129,13 @@
 	    $LN $BETA_WEBDIR/mercury-extras-$version-unstable.tar.gz \
 	        $BETA_WEBDIR/mercury-extras-$version.tar.gz &&
 	    $LN $BETA_WEBDIR/mercury-tests-$version-unstable.tar.gz \
-	        $BETA_WEBDIR/mercury-tests-$version.tar.gz 
+	        $BETA_WEBDIR/mercury-tests-$version.tar.gz &&
+	    $LN $BETA_WEBDIR/mercury-NEWS-$version-unstable.txt \
+	        $BETA_WEBDIR/mercury-NEWS-$version.tar.gz &&
+	    $LN $BETA_WEBDIR/mercury-INSTALL-$version-unstable.txt \
+	        $BETA_WEBDIR/mercury-INSTALL-$version.tar.gz 
 	    ;;
-	esac
+	esac || set_status "updating stable distribution"
 	;;
     *)
 	;;
--------------------------------------------------------------------------
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