[tor-commits] r25343: {website} Grab the last modified date from git if svn is unavailable T (in website/trunk: . include)

Sebastian Hahn tor-svn-commits at sebastianhahn.net
Wed Jan 25 02:12:01 UTC 2012


Author: sebastian
Date: 2012-01-25 02:12:01 +0000 (Wed, 25 Jan 2012)
New Revision: 25343

Modified:
   website/trunk/Makefile
   website/trunk/include/foot.wmi
Log:
Grab the last modified date from git if svn is unavailable

This allows us to build the website from a git-svn clone, and acts as a
first step towards a git migration

Modified: website/trunk/Makefile
===================================================================
--- website/trunk/Makefile	2012-01-24 23:54:07 UTC (rev 25342)
+++ website/trunk/Makefile	2012-01-25 02:12:01 UTC (rev 25343)
@@ -10,7 +10,7 @@
 # 4. make
 # 5. ./publish
 
-export TORGIT=set this to your tor.git path
+export TORGIT=/Users/killerchicken/coding/git/tor-git/tor/.git
 export STABLETAG=tor-0.2.2.35
 export DEVTAG=tor-0.2.3.10-alpha
 

Modified: website/trunk/include/foot.wmi
===================================================================
--- website/trunk/include/foot.wmi	2012-01-24 23:54:07 UTC (rev 25342)
+++ website/trunk/include/foot.wmi	2012-01-25 02:12:01 UTC (rev 25343)
@@ -11,16 +11,19 @@
 	Commons Attribution 3.0 United States License</a>, unless
 	otherwise noted.</p>
 <!--
-        # This will grab the date from svn info but formatting is tedious
-       	# REQUIRES svn for this to work
+        # This will grab the date from svn info/git
+        # REQUIRES svn or git for this to work
         <:{
-          my $svninfo = `svn info`;
+          my $svninfo = `svn info 2>/dev/null`;
+          my $modifydate;
           if ($svninfo =~ m/Last Changed Date: (\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})\s(.*)\s\((.*)\)/) {
-            my $modifydate = "$4 $2 $3";
+            $modifydate = "$4 $2 $3";
             # remove commas from date
             $modifydate =~ s/,//;
-            print 'Last modified: '.$modifydate."\n";
+          } else {
+            $modifydate = `git log --format=%cd -n 1`
           }
+          print 'Last modified: '.$modifydate."\n";
         }:>
         <:{
           #my $compiledate = `date`;



More information about the tor-commits mailing list