[m-rev.] for review: improve web site download index

Simon Taylor stayl at cs.mu.OZ.AU
Mon Aug 19 16:39:29 AEST 2002


On 19-Aug-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 19-Aug-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > tools/generate_index_html:
> > 	Improve the index.html files generated for the download
> > 	area of the web site so that the files are grouped by
> > 	release with proper descriptions on the links, rather than
> > 	just listed in alphabetical order.

> > Index: generate_index_html
> ...
> > +do_handle_release () {
> > +	file=$1
> > +	date=`echo $file | \
> > +		sed -e's/.*\([0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\).*/\1/'`
> 
> It would be simpler to use `expr' rather than `sed' here.
> 
> 	date=`expr "$file" : '.*\([0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\).*/'`

Done
 
> > +	case $file in
> ...
> > +	    *-0.10.2-beta*-unstable*)
> > +		release_name="Unstable 0.10.2 beta $date"
> > +		release_id="0.10.2-beta-$date-unstable"
> > +		;;
> > +	    *-0.10.2-beta*)
> > +		release_name="Stable 0.10.2 beta $date"
> > +		release_id="0.10.2-beta-$date"
> > +		;;
> > +	    *-0.10.1*)
> > +		release_name="Release 0.10.1"
> > +		release_id="0.10.1"
> > +		;;
> > +	    *-0.10*)
> > +		release_name="Release 0.10"
> > +		release_id="0.10"
> > +		;;
> 
> It would be best to avoid hard-coding the release numbers here.

Done.

> > +# Current release.
> > +#
> > +handle_release mercury-compiler-0.10.1.tar.gz
> > +
> > +#
> > +# Stable beta for current release + bug fixes.
> > +# There may be an unstable beta, but there's no point using it.
> > +#
> > +for file in mercury-compiler-0.10.2-beta*.tar.gz mercury-0.10.2-beta*.tar.gz
> 
> Likewise here.

Here it is unavoidable, but the release numbers are now hard-coded
in only one place.

> If there is really no way of avoiding the hard-coding, then you should
> mention in the file notes/release_checklist.html that this script needs
> to be updated.

Done.

Simon.


Estimated hours taken: 3

tools/generate_index_html:
	Improve the index.html files generated for the download
	area of the web site so that the files are grouped
	by release, rather than just listed in alphabetical order.

compiler/notes/release_checklist.html:
	generate_index_html now needs to be updated on each release
	so that the current release is listed first.

	The source distribution is now built on earth, not murlibobo.


--- generate_index_html	2002/08/19 05:52:47	1.1
+++ generate_index_html	2002/08/19 06:32:32
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/local/bin/bash
 #
 # generate_index_html
 #
@@ -9,6 +9,13 @@
 # own path!
 #
 
+CURRENT_RELEASE=0.10.1
+BETA_RELEASE=0.10.2
+
+# We need bash's extended globbing for the case patterns
+# matching the release numbers.
+shopt -s extglob
+
 INDEX=index.html.$HOST
 handled_files=
 
@@ -72,8 +79,7 @@
 
 do_handle_release () {
 	file=$1
-	date=`echo $file | \
-		sed -e's/.*\([0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\).*/\1/'`
+	date=`expr "$file" : '.*\([0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\).*'`
 
 	case $file in
 	    *-rotd*-unstable*)
@@ -84,21 +90,20 @@
 		release_name="Stable snapshot $date"
 		release_id="rotd-$date"
 		;;
-	    *-0.10.2-beta*-unstable*)
-		release_name="Unstable 0.10.2 beta $date"
-		release_id="0.10.2-beta-$date-unstable"
-		;;
-	    *-0.10.2-beta*)
-		release_name="Stable 0.10.2 beta $date"
-		release_id="0.10.2-beta-$date"
-		;;
-	    *-0.10.1*)
-		release_name="Release 0.10.1"
-		release_id="0.10.1"
-		;;
-	    *-0.10*)
-		release_name="Release 0.10"
-		release_id="0.10"
+	    *-*([0-9.])-beta*-unstable*)
+		version=`expr "$file" : ".*-\([0-9.]*\)-beta.*-unstable.*"`
+		release_name="Unstable $version beta $date"
+		release_id="$version-beta-$date-unstable"
+		;;
+	    *-*([0-9.])-beta*)
+		version=`expr "$file" : ".*-\([0-9.]*\)-beta.*"`
+		release_name="Stable $version beta $date"
+		release_id="$version-beta-$date"
+		;;
+	    *-*([0-9.])*)
+		version=`expr "$file" : ".*-\([0-9.]*[0-9]\).*"`
+		release_name="Release $version"
+		release_id="$version"
 		;;
 	    *)
 		# Unknown release, this will be put in the list of
@@ -167,13 +172,14 @@
 #
 # Current release.
 #
-handle_release mercury-compiler-0.10.1.tar.gz
+handle_release mercury-compiler-${CURRENT_RELEASE}.tar.gz
 
 #
 # Stable beta for current release + bug fixes.
 # There may be an unstable beta, but there's no point using it.
 #
-for file in mercury-compiler-0.10.2-beta*.tar.gz mercury-0.10.2-beta*.tar.gz
+for file in mercury-compiler-${BETA_RELEASE}-beta*.tar.gz \
+		mercury-${BETA_RELEASE}-beta*.tar.gz
 do
 	case $file in
 		*-unstable*) ;;
Index: compiler/notes/release_checklist.html
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/notes/release_checklist.html,v
retrieving revision 1.19
diff -u -u -r1.19 release_checklist.html
--- compiler/notes/release_checklist.html	19 Oct 2001 05:24:36 -0000	1.19
+++ compiler/notes/release_checklist.html	19 Aug 2002 06:33:52 -0000
@@ -64,6 +64,10 @@
 	  Modify release.html to refer to the new html files you have
 	  created, and change the links to download the release. 
 
+     <li> Update the CURRENT_RELEASE and BETA_RELEASE variables in
+	  tools/generate_index_html so that the new release is listed
+	  first on the download page.
+
      <li> Don't commit your changes to the main branch yet, because
 	  otherwise it would be installed on the WWW pages overnight.
      </ul>
@@ -77,7 +81,7 @@
      set the RELEASE_VERSION and CHECKOUT_OPTS variables
      as explained in the comments there.
 
-<li> Run tools/run_all_tests_from_cron on murlibobo.
+<li> Run tools/run_all_tests_from_cron on earth.
      (Or just wait 24 hours or so.) <p>
 
      This should have the effect of checking out a fresh copy, and doing
@@ -89,14 +93,14 @@
 	mercury_cv_bits_per_word=32 \
 	mercury_cv_unboxed_floats=no \
 	sh configure --prefix=$INSTALL_DIR &&
-	mmake MMAKEFLAGS='EXTRA_MCFLAGS="-O5 --opt-space" -j6' tar
+	mmake MMAKEFLAGS='EXTRA_MCFLAGS="-O5 --opt-space"' tar
 	</pre>
 	
 	<p>
 
     If it passes all the tests, it should put the resulting tar file in
-    /home/mercury/public/test_mercury/test_dirs/mercury-latest-stable and
-    ftp://ftp.mercury.cs.mu.oz.au/pub/mercury/beta-releases.
+    /home/mercury/public/test_mercury/test_dirs/earth/mercury-latest-stable
+    and ftp://ftp.mercury.cs.mu.oz.au/pub/mercury/beta-releases.
 
 <li>  Test it on lots of architectures. <br>
 
--------------------------------------------------------------------------
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