? LXR.patch Index: ChangeLog =================================================================== RCS file: /cvs/gnome/lxr/ChangeLog,v retrieving revision 1.10 diff -u -r1.10 ChangeLog --- ChangeLog 11 Sep 2003 17:11:20 -0000 1.10 +++ ChangeLog 1 Apr 2004 02:13:50 -0000 @@ -1,3 +1,11 @@ +2004-03-31 Gregory Leblanc + + reviewed by: kidcrash@bellsouth.net + + * ident: Mucked with the version string near the top from import + * lib/LXR/Common.pm: Changes from Importing the latest sources + upstream. + 2003-09-11 Gregory Leblanc * index.html: State that LXR is currently disabled. We'll need to Index: ident =================================================================== RCS file: /cvs/gnome/lxr/ident,v retrieving revision 1.2 diff -u -r1.2 ident --- ident 13 May 2003 20:56:45 -0000 1.2 +++ ident 1 Apr 2004 02:13:50 -0000 @@ -1,6 +1,5 @@ #!/usr/bonsaitools/bin/perl -# $Id: ident,v 1.2 2003/05/13 20:56:45 gleblanc Exp $ - +# $Id: ident,v 1.1.1.2 2004/03/31 22:23:02 gleblanc Exp $ # ident -- Look up identifiers # # Arne Georg Gleditsch Index: lib/LXR/Common.pm =================================================================== RCS file: /cvs/gnome/lxr/lib/LXR/Common.pm,v retrieving revision 1.3 diff -u -r1.3 Common.pm --- lib/LXR/Common.pm 17 Jul 2003 10:45:23 -0000 1.3 +++ lib/LXR/Common.pm 1 Apr 2004 02:13:51 -0000 @@ -1,4 +1,4 @@ -# $Id: Common.pm,v 1.3 2003/07/17 10:45:23 jamesh Exp $ +# $Id: Common.pm,v 1.1.1.2 2004/03/31 22:23:05 gleblanc Exp $ package LXR::Common; @@ -440,6 +440,21 @@ return($Conf, $HTTP, $Path); } +sub pretty_date +{ + my $time = shift; + my @t = gmtime($time); + my ($sec, $min, $hour, $mday, $mon, $year,$wday) = @t; + my @days = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); + my @months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); + $year += 1900; + $wday = $days[$wday]; + $mon = $months[$mon]; + return sprintf("%s, %2d %s %d %02d:%02d:%02d GMT", + $wday, $mday, $mon, $year, $hour, $min, $sec); +} + sub init_all { my ($argv_0) = @_; @@ -484,19 +499,12 @@ if ($file1) { $time1 = (stat($file1))[9]; } if ($file2) { $time2 = (stat($file2))[9]; } - my $time = ($time1 > $time2 ? $time1 : $time2); - if ($time > 0) { - my @t = gmtime($time); - my ($sec, $min, $hour, $mday, $mon, $year,$wday) = @t; - my @days = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); - my @months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); - $year += 1900; - $wday = $days[$wday]; - $mon = $months[$mon]; + my $mod_time = ($time1 > $time2 ? $time1 : $time2); + if ($mod_time > 0) { # Last-Modified: Wed, 10 Dec 1997 00:55:32 GMT - print sprintf("Last-Modified: %s, %2d %s %d %02d:%02d:%02d GMT\n", - $wday, $mday, $mon, $year, $hour, $min, $sec); + print ("Last-Modified: ".(pretty_date($mod_time))."\n"); + # Expires: Thu, 11 Dec 1997 00:55:32 GMT + print ("Expires: ".(pretty_date($mod_time+1200))."\n"); } # Close the HTTP header block.