You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2006/10/04 05:55:48 UTC

svn commit: r452711 - /spamassassin/trunk/sa-update.raw

Author: dos
Date: Tue Oct  3 20:55:47 2006
New Revision: 452711

URL: http://svn.apache.org/viewvc?view=rev&rev=452711
Log:
bug 5044: include local site config in sa-update lint checks

Modified:
    spamassassin/trunk/sa-update.raw

Modified: spamassassin/trunk/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-update.raw?view=diff&rev=452711&r1=452710&r2=452711
==============================================================================
--- spamassassin/trunk/sa-update.raw (original)
+++ spamassassin/trunk/sa-update.raw Tue Oct  3 20:55:47 2006
@@ -362,6 +362,19 @@
   }
 }
 
+# --lint check the current site config before we download any updates so that
+# a site with a broken config, with sa-update in a cron job, doesn't hammer
+# the update servers continously downloading and then aborting the update when
+# the lint check of the update (with the site config included) fails.
+# Wait until now to do it since nothing above depends on a successful --lint.
+
+if (!lint_check_dir(File::Spec->catfile($opt{'updatedir'}, "doesnotexist"))) {
+  warn "error: lint check of current site config failed, cannot continue\n";
+  dbg("diag: local site config must successfully lint before doing updates, ".
+	"exiting with code 2");
+  exit 2;
+}
+
 my $res = Net::DNS::Resolver->new();
 
 my $ua = LWP::UserAgent->new();
@@ -1239,7 +1252,6 @@
   # "config" or otherwise be more terse. :(
   my $spamtest = new Mail::SpamAssassin( {
     rules_filename      => $dir,
-    site_rules_filename => File::Spec->catfile($dir, "doesnotexist"),
     userprefs_filename  => File::Spec->catfile($dir, "doesnotexist"),
 
     local_tests_only    => 1,
@@ -1426,6 +1438,8 @@
 installed successfully.
 
 An exit code of C<1> means no fresh updates were available.
+
+An exit code of C<2> means that a lint check of the current site config failed.
 
 An exit code of C<4> or higher, indicates that errors occurred while
 attempting to download and extract updates.