Mailing List Archive

svn commit: r452712 - /spamassassin/branches/3.1/sa-update.raw
Author: dos
Date: Tue Oct 3 20:56:06 2006
New Revision: 452712

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

Modified:
spamassassin/branches/3.1/sa-update.raw

Modified: spamassassin/branches/3.1/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/sa-update.raw?view=diff&rev=452712&r1=452711&r2=452712
==============================================================================
--- spamassassin/branches/3.1/sa-update.raw (original)
+++ spamassassin/branches/3.1/sa-update.raw Tue Oct 3 20:56:06 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();
@@ -1187,7 +1200,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,
@@ -1374,6 +1386,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.