You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2022/04/23 07:41:02 UTC

svn commit: r1900187 - in /spamassassin/trunk: Makefile.PL lib/Mail/SpamAssassin/Util/DependencyInfo.pm sa-update.raw

Author: hege
Date: Sat Apr 23 07:41:02 2022
New Revision: 1900187

URL: http://svn.apache.org/viewvc?rev=1900187&view=rev
Log:
Remove HTTP::Date dependency

Modified:
    spamassassin/trunk/Makefile.PL
    spamassassin/trunk/lib/Mail/SpamAssassin/Util/DependencyInfo.pm
    spamassassin/trunk/sa-update.raw

Modified: spamassassin/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/spamassassin/trunk/Makefile.PL?rev=1900187&r1=1900186&r2=1900187&view=diff
==============================================================================
--- spamassassin/trunk/Makefile.PL (original)
+++ spamassassin/trunk/Makefile.PL Sat Apr 23 07:41:02 2022
@@ -380,7 +380,6 @@ $makefile{META_MERGE} = {
     'DBI' =>                       0,
     'Getopt::Long' =>              2.32,
     'LWP::UserAgent' =>            0,
-    'HTTP::Date' =>                0,
     'Archive::Tar' =>              1.23,
     'IO::Zlib' =>                  1.04,
     'Encode::Detect' =>            0

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util/DependencyInfo.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Util/DependencyInfo.pm?rev=1900187&r1=1900186&r2=1900187&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util/DependencyInfo.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util/DependencyInfo.pm Sat Apr 23 07:41:02 2022
@@ -235,13 +235,7 @@ our @OPTIONAL_MODULES = (
 {
   module => 'LWP::UserAgent',
   version => 0,
-  desc => 'The "sa-update" program requires this module to make HTTP requests.',
-},
-{
-  module => 'HTTP::Date',
-  version => 0,
-  desc => 'The "sa-update" program requires this module to make HTTP
-  If-Modified-Since GET requests.',
+  desc => 'The "sa-update" program can use this module to make HTTP requests.',
 },
 {
   module => 'Encode::Detect::Detector',

Modified: spamassassin/trunk/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-update.raw?rev=1900187&r1=1900186&r2=1900187&view=diff
==============================================================================
--- spamassassin/trunk/sa-update.raw (original)
+++ spamassassin/trunk/sa-update.raw Sat Apr 23 07:41:02 2022
@@ -86,7 +86,6 @@ BEGIN {                          # see c
 
 # These are the non-standard required modules
 use Net::DNS;
-use HTTP::Date qw(time2str);
 use Archive::Tar 1.23;
 use IO::Zlib 1.04;
 use Mail::SpamAssassin::Logger qw(:DEFAULT info log_message);
@@ -1534,7 +1533,11 @@ sub http_get_lwp {
     $request->url($url);
 
     if (defined $ims) {
-      my $str = time2str($ims);
+      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime($ims);
+      my $str = sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",
+          qw(Sun Mon Tue Wed Thu Fri Sat)[$wday], $mday,
+          qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)[$mon],
+          $year + 1900, $hour, $min, $sec);
       $request->header('If-Modified-Since', $str);
       dbg("http: IMS GET request, $url, $str");
     }