You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/10/22 00:32:31 UTC

svn commit: rev 55280 - spamassassin/branches/3.0

Author: quinlan
Date: Thu Oct 21 15:32:29 2004
New Revision: 55280

Modified:
   spamassassin/branches/3.0/Makefile.PL
Log:
bug 3822: warn during "make" if module versions are too low


Modified: spamassassin/branches/3.0/Makefile.PL
==============================================================================
--- spamassassin/branches/3.0/Makefile.PL	(original)
+++ spamassassin/branches/3.0/Makefile.PL	Thu Oct 21 15:32:29 2004
@@ -183,6 +183,7 @@
     },
 
     # be quite explicit about this; afaik CPAN.pm is sensible using this
+    # also see CURRENT_PM below
     'PREREQ_PM' => {
         'Digest::SHA1'  => 0,             # 2.0 is oldest tested version
         'File::Spec'    => 0.8,           # older versions lack some routines we need
@@ -234,11 +235,18 @@
     # Don't add META.yml to the MANIFEST for god's sake!
     'NO_META' => 1,
 );
+
 # That META.yml stuff was introduced with Perl 6.06_03, see
 # <http://archive.develooper.com/makemaker@perl.org/msg00922.html>
 # <http://archive.develooper.com/makemaker@perl.org/msg00984.html>
 delete $makefile{'NO_META'} if $mm_version < 6.06_03;
 
+# make sure certain optional modules are up-to-date if they are installed
+# also see PREREQ_PM above
+my %CURRENT_PM = (
+    'Net::DNS' => (RUNNING_ON_WINDOWS ? 0.46 : 0.34),
+    'Razor2::Client::Agent' => 2.40,
+);
 
 if (bool($opt{'__cruft'}, 0) and not bool($opt{'ignore_cruft'}, 0)) {
   my $error = <<OLD_CRUFT;
@@ -411,6 +419,21 @@
 }
 else {
   unlink("t/bayessql.cf");
+}
+
+# check optional module versions
+while (my ($module, $version) = each %CURRENT_PM) {
+  my $eval = "require $module";
+  eval $eval;
+
+  if ($@) {
+    next;
+  }
+  elsif ($module->VERSION < $version) {
+    warn("Warning: optional module $module $version not found (" .
+	 $module->VERSION .
+	 " currently installed)");
+  }
 }
 
 #######################################################################