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

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Aug 19 15:45:13 AEST 2002


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.

This change is a very good idea.

> 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]\).*/'`

> +	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.

E.g.
	    *-[0-9.]*-beta*-unstable*)
	    	version=`expr "$file" : ".*-\([0-9.]*\)-beta.*-unstable.*"`
		release_name="Unstable $version beta $date"
		;;
	    *-[0-9.]*-beta*)
	    	version=`expr "$file" : ".*-\([0-9.]*\)-beta.*"`
		release_name="Stable $version beta $date"
		;;
	    *-[0-9.]*)
	    	version=`expr "$file" : ".*-\([0-9.]*\).*"`
		release_name="Stable $version beta $date"
		;;

> +#
> +# 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.

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.

-- 
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