[m-rev.] for review: changes to download pages

Ian MacLarty maclarty at cs.mu.OZ.AU
Fri Nov 11 12:35:07 AEDT 2005


Thanks for your previous comments, Julien.
I've applied all the changes you suggested and have also made another change:
Instead of generating the ROTD page with a CGI script I now generate it on
installation.  I have also moved the responsibility of deleting the old ROTDs
from the test_mercury script to the install_web_pages script.  This I think is
neater, more secure and removes the dependence on cgi scripts.  The old
versions must be deleted after the web site is installed to avoid links to
non-existant files.

Here's the revised log:

Estimated hours taken: 10

Change the layout of the download pages to make them more user-friendly.

The main download page now contains a short description of each available
version of the compiler and a link to a more detailed download page.
There is no longer a distinction between the stable and unstable releases of
the day on the website, instead we link to the latest ``unstable'' version
only.  The main download page contains a link to the current version and the
release of the day and a link to the beta version only if there is one.

The snapshot page now looks similar to the current release page, except that it
contains information about the release of the day.  Previously the snapshot
page contained information about all the different versions of the Mercury
compiler.

The latest release of the day version is determined by examining the files
currently on the web server.  Once the website has been installed, old versions
of the rotd are deleted from the website (this used to be done by the
test_mercury script which meant that it had to generate the html page
with links to the ROTD files).

w3/Makefile:
	Add a WWW_DOMAIN variable which can be used to test the website from
	another web server.

	Make the images directory executable by all.

	Add a new rule that removes old versions of the ROTD.
w3/Makefile.common:
	Give default values for WWW_DOMAIN and allow
	the php command to be overridden if necessary.

	Define BETA_FTPDIR and BETA_WEBDIR variables
	which point to where the rotd files are kept.

w3/RELEASE_INFO:
	Make NEXT_BETA_VERSION blank.  If NEXT_BETA_VERSION is set then there
	will be link to it from the main download page.

w3/bin/install_webpages
	Remove the old versions of the ROTD after the website has been
	installed.

w3/download/Makefile:
	Fix an incorrect version number.

w3/download/include/release.inc:
	Use the new php variables which contain the www and ftp domains.
	Remove a redundant comment.

w3/download/include/rotd.inc:
	Change the snapshot download page so that it looks more like the
	current release download page and links to the source
	distribution files directly.

w3/include/download.inc:
	Change the main download page to contain a description of each
	available version.
	Only show a beta version if there is a beta version available.

w3/include/globals.inc.in:
	Add variables for the ROTD version and the ftp and www domains.

And here are the relevant parts of the interdiff.
Note that all the cgi scripts and README were removed
(most of the README was to document stuff to do with
the cgi scripts).

diff -u Makefile Makefile
--- Makefile	30 Sep 2005 02:57:41 -0000
+++ Makefile	10 Nov 2005 11:23:44 -0000
@@ -41,7 +41,6 @@

 local_install:
 	$(CP) images $(INSTALL_WEBDIR)
-	cd cgi-bin && $(MAKE) install
 	chgrp -R mercury $(INSTALL_WEBDIR)/images
 	chmod -R g+w,a+rx $(INSTALL_WEBDIR)/images

@@ -49,6 +48,27 @@

 local_clean:
 	rm -f include/globals.inc
+
+ROTD_PATTERNS = mercury-compiler-rotd-*-unstable.tar.gz \
+	mercury-extras-rotd-*-unstable.tar.gz 		\
+	mercury-tests-rotd-*-unstable.tar.gz 		\
+	mercury-test-failures-rotd-*-unstable.txt	\
+	mercury-NEWS-rotd-*-unstable.txt		\
+	mercury-INSTALL-rotd-*-unstable.txt
+
+delete_old_rotds:
+	for installed_path in $(BETA_WEBDIR) $(BETA_FTPDIR); 		     \
+	do								     \
+		for pattern in $(ROTD_PATTERNS); 			     \
+		do							     \
+			path_and_pattern="$$installed_path/$$pattern";       \
+			num_matches=`ls $$path_and_pattern | wc -l`;	     \
+			num_matches_minus_one=`expr $$num_matches - 1`;      \
+			ls -t $$path_and_pattern | 			     \
+				tail -n $$num_matches_minus_one /dev/stdin | \
+				xargs rm -f ;				     \
+		done;							     \
+	done

 #-----------------------------------------------------------------------------#

diff -u Makefile.common Makefile.common
--- Makefile.common	30 Sep 2005 02:50:41 -0000
+++ Makefile.common	10 Nov 2005 11:36:00 -0000
@@ -8,12 +8,11 @@
 	PHP3=/usr/lib/cgi-bin/php3 -q
 endif
 ifndef WWW_DOMAIN
-	# The domain cannot be www.cs.mu.oz.au/mercury, because the
-	# departmental web server does not handle cgi scripts.
 	WWW_DOMAIN="www.mercury.cs.mu.oz.au"
 endif
-ifndef CGIBIN_DIR
-	CGIBIN_DIR="/usr/lib/cgi-bin"
+BETA_WEBDIR="$(INSTALL_WEBDIR)/download/files/beta-releases/rotd"
+ifndef BETA_FTPDIR
+	BETA_FTPDIR="/home/ftp/pub/mercury/beta-releases/rotd"
 endif
 CP=cp -af

diff -u download/include/rotd.inc download/include/rotd.inc
--- download/include/rotd.inc	30 Sep 2005 10:49:21 -0000
+++ download/include/rotd.inc	10 Nov 2005 07:29:00 -0000
@@ -68,15 +68,13 @@
 <p>

 <ul>
-    <li> x86 machines running other versions of Microsoft Windows
-         (95, 98, 98SE, ME, NT, 2000)
+    <li> x86 machines running Microsoft Windows NT, 2000 or XP.
     <li> x86 machines running other versions of Linux
          (however, there are some known problems with the version of GNU C
 	 that shipped with Red Hat Linux 7.0)
     <li> x86 machines running FreeBSD 3.0
     <li> x86 machines running other BSD Unix systems
     <li> x86 machines running SunOS 5.x
-    <li> x86 machines running Microsoft Windows XP
     <li> PowerPC machines running Linux
     <li> PowerPC machines running Mac OS 10.3 and above
     <li> Sun SPARC machines running SunOS 4.x and 5.x
diff -u include/download.inc include/download.inc
--- include/download.inc	30 Sep 2005 02:40:31 -0000
+++ include/download.inc	10 Nov 2005 07:39:16 -0000
@@ -3,7 +3,8 @@
 The Mercury compiler is free software, and is distributed under the
 terms of the GNU General Public License.
 <p>
-There are two main versions of Mercury available at any point in time.
+There are <? echo($next_beta_version == "" ? "two" : "three"); ?>
+main versions of Mercury available at the moment.

 <H3> Current stable release </H3>

@@ -45,2 +46,2 @@
-The latest release of the day is available
-<a href="http://<?echo $www_domain; ?>/cgi-bin/generate_rotd_page">here</a>.
+The <a href="download/rotd.html">current release of the day</a>
+is version <? echo $rotd_version; ?>.
diff -u include/globals.inc.in include/globals.inc.in
--- include/globals.inc.in	30 Sep 2005 02:40:31 -0000
+++ include/globals.inc.in	10 Nov 2005 10:34:25 -0000
@@ -1,8 +1,9 @@
 <?
 	$installed_path="/home/mercury5/installed_w3";
+
 	$current_release="<RELEASE_VERSION>";
 	$next_beta_version="<NEXT_BETA_VERSION>";
-	$rotd_version="<ROTD_VERSION>";
+
 	$release_doc_dir="$root/information/doc-release";
 	$latest_doc_dir="$root/information/doc-latest";
 	$ref_man_release="$release_doc_dir/mercury_ref/index.html";
@@ -17,4 +18,10 @@
 	$faq_latest="$latest_doc_dir/mercury_faq/index.html";
-	$ftp_domain="ftp.mercury.cs.mu.oz.au";
-	$www_domain="<WWW_DOMAIN>";
+
+	$rotd_basedir="download/files/beta-releases/rotd";
+	$rotd_files_path="$installed_path/$rotd_basedir";
+	exec("cat $rotd_files_path/latest-unstable-version", $exec_output);
+	$rotd_version=$exec_output[0];
+
+ 	$ftp_domain="ftp.mercury.cs.mu.oz.au";
+ 	$www_domain="<WWW_DOMAIN>";
 ?>
only in patch2:
--- bin/install_webpages	21 Jan 2004 06:36:24 -0000	1.24
+++ bin/install_webpages	10 Nov 2005 10:07:21 -0000
@@ -59,6 +59,7 @@
 cvs update -d . || echo "*** cvs update failed" 1>&2
 cvs checkout tutorial || echo "*** cvs checkout failed" 1>&2
 make install || echo "*** make install failed" 1>&2
+make delete_old_rotds || echo "*** make delete_old_rotds failed" 1>&2

     #
     # Reindex the web site for searching.


Here's the CVS log and diff for the change to test_mercury:

Estimated hours taken: 0.2
Branches: main

tools/test_mercury:
	Do not delete old versions of the release of the day.
	These are now deleted when the web site has finished installing.

Index: test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.266
diff -u -r1.266 test_mercury
--- test_mercury	3 Nov 2005 09:13:08 -0000	1.266
+++ test_mercury	10 Nov 2005 08:57:53 -0000
@@ -955,20 +955,11 @@
 	fi &&
 	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 &&
 	ssh $BETA_FTPHOST "\
 		echo $version > $BETA_FTPDIR/latest-unstable-version" &&
 	([ -d $BETA_WEBDIR ] || mkdir $BETA_WEBDIR) &&
-	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 &&
-	rm -f $BETA_WEBDIR/mercury-*-$RELEASE_VERSION_PATTERN-unstable.txt &&
 	cp $UNSTABLE/mercury-*-$version-unstable.* $BETA_WEBDIR &&
 	echo $version > $BETA_WEBDIR/latest-unstable-version \
 	|| set_status "copying ROTD"

Ian.

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