[or-cvs] r18735: {website} Change mirror script to use "up to date" or "out of date" to (website/trunk)

phobos at seul.org phobos at seul.org
Mon Mar 2 03:43:10 UTC 2009


Author: phobos
Date: 2009-03-01 22:43:10 -0500 (Sun, 01 Mar 2009)
New Revision: 18735

Modified:
   website/trunk/update-mirrors.pl
Log:
Change mirror script to use "up to date" or "out of date" to represent
the age of the files in the mirror.


Modified: website/trunk/update-mirrors.pl
===================================================================
--- website/trunk/update-mirrors.pl	2009-03-02 02:58:15 UTC (rev 18734)
+++ website/trunk/update-mirrors.pl	2009-03-02 03:43:10 UTC (rev 18735)
@@ -16,7 +16,7 @@
 print "Creating LWP agent ($LWP::VERSION)...\n";
 my $lua = LWP::UserAgent->new(
     keep_alive => 1,
-    timeout => 15,
+    timeout => 1,
     agent => "Tor MirrorCheck Agent"
 );
 
@@ -620,6 +620,10 @@
 print "We have a total of $count mirrors\n";
 print "Fetching the last updated date for each mirror.\n";
 
+my $tortime;
+$tortime = FetchDate("http://www.torproject.org/");
+print "The official time for Tor is $tortime. \n";
+
 foreach my $server ( keys %m ) {
 
     print "Attempting to fetch from $m{$server}{'orgName'}\n";
@@ -664,8 +668,10 @@
 
      my $time;
      if( "$m{$server}{'updateDate'}" ne "Unknown") {
-        $time = ctime($m{$server}{'updateDate'});
+	if( "$m{$server}{'updateDate'}" eq "$tortime" ) {
+	$time = "Up to date";
         chomp($time);
+	} else { $time = "Out of date"; }
      } else { $time = "Unknown"; }
 print OUT <<"END";
      \n<tr>\n



More information about the tor-commits mailing list