You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/11/03 19:32:31 UTC

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

Author: jm
Date: Fri Nov  3 10:32:30 2006
New Revision: 470935

URL: http://svn.apache.org/viewvc?view=rev&rev=470935
Log:
bug 5165: 'sa-update --checkonly' added to check for updates without applying them; thanks to <anomie /at/ users.sourceforge.net>

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=470935&r1=470934&r2=470935
==============================================================================
--- spamassassin/trunk/sa-update.raw (original)
+++ spamassassin/trunk/sa-update.raw Fri Nov  3 10:32:30 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: update available and in checkonly mode, exiting now");
+    $exit = 0;
+    last;
+  }
+
   # Read in the MIRRORED.BY file if it exists
   if (open(MIRBY, $mirby_path)) {
     local $/ = undef;
@@ -1283,6 +1291,8 @@
   				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
@@ -1334,6 +1344,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
@@ -1423,7 +1438,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.