[openssl-commits] [web] master update

Richard Levitte levitte at openssl.org
Mon Mar 23 20:31:24 UTC 2015


The branch master has been updated
       via  e390df779af965c340d0b7940a6c361a27177e18 (commit)
      from  d7576bdb40be362dc3f67b36abfff794a7251538 (commit)


- Log -----------------------------------------------------------------
commit e390df779af965c340d0b7940a6c361a27177e18
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 23 21:25:08 2015 +0100

    Make a virtual link to the latest source called latest.tar.gz
    
    The idea came from Rich Salz and Stefan Eissing <stefan.eissing at greenbytes.de>
    and is that it would be nice if a script could ask for /source/latest.tar.gz
    and get a 302 that points at the actual latest tarball.
    
    For this to become as smooth as possible, it required three things:
    - add some markup around the latest tarball (a <span class="latest"> wrapper),
      done in openssl.wml.
    - Move source/.htaccess to source/.htaccess.in and add an appropriate rewrite
      to implement the 302, with a visible marker indicating where the file name
      of the currently latest tarball should be inserted.
    - do a bit of hackery in Makefile to extract the latest file name from
      source/index.html after that one has been rebuilt, and use that to create
      source/.htaccess from source/.htaccess.in.

-----------------------------------------------------------------------

Summary of changes:
 Makefile                           | 8 +++++++-
 openssl.wml                        | 2 +-
 source/{.htaccess => .htaccess.in} | 2 ++
 3 files changed, 10 insertions(+), 2 deletions(-)
 rename source/{.htaccess => .htaccess.in} (92%)

diff --git a/Makefile b/Makefile
index e2670e3..3f2f4d5 100644
--- a/Makefile
+++ b/Makefile
@@ -23,8 +23,14 @@ generated:
 	perl run-fundingfaq.pl < support/funding/support-faq.txt >support/funding/support-faq.inc
 	( cd news && xsltproc vulnerabilities.xsl vulnerabilities.xml > vulnerabilities.wml )
 
-simple:
+simple: rebuild hack-source_htaccess
+rebuild:
 	wmk $(FORCE) -I $(SNAP) -a $(DIRS) index.wml
+hack-source_htaccess:
+	latest=`grep '<span class="latest">' < source/index.html | \
+		sed -e 's|^.*<span class="latest">||' -e 's|</span>.*$$||'`; \
+	    sed -e "s|%%LATEST%%|$$latest|" \
+		< source/.htaccess.in > source/.htaccess
 
 manpages:
 	sh ./run-pod2html.sh $(PODSHOME)
diff --git a/openssl.wml b/openssl.wml
index cf202af..6369cb0 100644
--- a/openssl.wml
+++ b/openssl.wml
@@ -372,7 +372,7 @@ foreach $l (@L) {
     $l =~ s|(\s+)(\S+/)(\s*\n)$|$1."<a href=\"$2\"><b>$2</b></a>".$3|e;
     foreach $hi (@HI) {
         $l =~ s|^(.*$hi.*)$|<font color="#cc3333">$1  <b>[LATEST]</b></font>|;
-        $l =~ s|>($hi)<|><font color="#cc3333">$1</font><|;
+        $l =~ s|>($hi)<|><font color="#cc3333"><span class="latest">$1</span></font><|;
     }
     print $l;
 }
diff --git a/source/.htaccess b/source/.htaccess.in
similarity index 92%
rename from source/.htaccess
rename to source/.htaccess.in
index 9fe909e..7ee68ac 100644
--- a/source/.htaccess
+++ b/source/.htaccess.in
@@ -29,3 +29,5 @@ RewriteRule openssl-(fips.*)  old/fips/openssl-$1 [L]
 <Files *.gz.sha1>
     RemoveEncoding .gz
 </Files>
+
+RewriteRule ^/latest.tar.gz$ /%%LATEST%% [R=302,NC]


More information about the openssl-commits mailing list