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/12/08 22:49:58 UTC

svn commit: r484806 - /spamassassin/branches/3.1/sa-update.raw

Author: dos
Date: Fri Dec  8 13:49:57 2006
New Revision: 484806

URL: http://svn.apache.org/viewvc?view=rev&rev=484806
Log:
bug 5165: implement sa-update --checkonly

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=484806&r1=484805&r2=484806
==============================================================================
--- spamassassin/branches/3.1/sa-update.raw (original)
+++ spamassassin/branches/3.1/sa-update.raw Fri Dec  8 13:49:57 2006
@@ -146,6 +146,7 @@
   'debug|D:s'                           => \$opt{'debug'},
   'version|V'                           => \$opt{'version'},
   'help|h|?'                            => \$opt{'help'},
+  'checkonly'                           => \$opt{'checkonly'},
 
   # allow multiple of these on the commandline
   'gpgkey=s'				=> $opt{'gpgkey'},
@@ -442,6 +443,13 @@
     next;
   }
 
+  # If we are only checking for update availability, exit now
+  if ( defined $opt{'checkonly'} ) {            
+    dbg("channel: $channel: update available, not downloading in checkonly mode");
+    $exit = 0;
+    next;
+  }
+
   # Read in the MIRRORED.BY file if it exists
   if (open(MIRBY, $mirby_path)) {
     local $/ = undef;
@@ -1228,12 +1236,10 @@
   --updatedir path		Directory to place updates, defaults to the
 				SpamAssassin site rules directory (def:
 				/var/lib/spamassassin/<version>)
-
   --channel channel		Retrieve updates from this channel
   				Use multiple times for multiple channels
   --channelfile file		Retrieve updates from the channels in the file
-
-
+  --checkonly		        Check for update availability, do not install
   --gpgkey key			Trust the key id to sign releases
   				Use multiple times for multiple keys
   --gpgkeyfile file		Trust the key ids in the file to sign releases
@@ -1243,7 +1249,6 @@
 				--gpgkey and --gpgkeyfile options)
   --import file			Import GPG key(s) from file into sa-update's
 				keyring. Use multiple times for multiple files
-
   -D, --debug [area=n,...]	Print debugging messages
   -V, --version			Print version
   -h, --help			Print usage message
@@ -1284,6 +1289,11 @@
 file instead of on the commandline.  This is extremely useful when there are a
 lot of additional channels.
 
+=item B<--checkonly>
+
+Only check if an update is available, don't actually download and install it.
+The exit code will be C<0> or C<1> as described below.
+
 =item B<--gpg>, B<--nogpg>
 
 sa-update by default will verify update archives by use of a SHA1 checksum
@@ -1373,7 +1383,7 @@
 =head1 EXIT CODES
 
 An exit code of C<0> means an update was available, and was downloaded and
-installed successfully.
+installed successfully if --checkonly was not specified.
 
 An exit code of C<1> means no fresh updates were available.