You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fa...@apache.org on 2007/05/03 18:56:53 UTC

svn commit: r534933 - /spamassassin/trunk/sa-compile.raw

Author: fanf
Date: Thu May  3 09:56:51 2007
New Revision: 534933

URL: http://svn.apache.org/viewvc?view=rev&rev=534933
Log:
Add a --updatedir option, like sa-update. (Bug 5446)

Modified:
    spamassassin/trunk/sa-compile.raw

Modified: spamassassin/trunk/sa-compile.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-compile.raw?view=diff&rev=534933&r1=534932&r2=534933
==============================================================================
--- spamassassin/trunk/sa-compile.raw (original)
+++ spamassassin/trunk/sa-compile.raw Thu May  3 09:56:51 2007
@@ -88,6 +88,7 @@
   'configpath|config-file|config-dir|c|C=s' => \$opt{'configpath'},
   'prefspath|prefs-file|p=s'                => \$opt{'prefspath'},
   'siteconfigpath=s'                        => \$opt{'siteconfigpath'},
+  'updatedir=s'                             => \$opt{'updatedir'},
   'cf=s'                                    => \@{$opt{'cf'}},
   'debug|D:s'       => \$opt{'debug'},
   'help|h|?'        => \$opt{'help'},
@@ -155,7 +156,13 @@
 $spamtest->{bases_can_use_char_classes} = 0;
 $spamtest->{bases_split_out_alternations} = 1;
 
-my $installdir = $spamtest->sed_path('__local_state_dir__/compiled/__version__');
+if (defined $opt{'updatedir'}) {
+  $opt{'updatedir'} = Mail::SpamAssassin::Util::untaint_file_path($opt{'updatedir'});
+}
+else {
+  $opt{'updatedir'} = $SA->sed_path('__local_state_dir__/compiled/__version__');
+}
+my $installdir = $opt{'updatedir'};
 if ((!defined $opt{'list'})
         && !$opt{'sudo'}
         && -d $installdir && !-w $installdir)
@@ -637,6 +644,8 @@
                                 Set user preferences file
   --siteconfigpath=path         Path for site configs
                                 (default: /etc/mail/spamassassin)
+  --updatedir=path              Directory to place updates
+                      (default: /var/lib/spamassassin/compiled/<version>)
   --cf='config line'            Additional line of configuration
   -D, --debug [area=n,...]	Print debugging messages
   -V, --version			Print version
@@ -689,6 +698,19 @@
 
 Use the specified path for locating site-specific configuration files.  Ignore
 the default directories (usually C</etc/mail/spamassassin> or similar).
+
+=item B<--updatedir>
+
+By default, C<sa-compile> will use the system-wide rules update directory:
+
+        @@LOCAL_STATE_DIR@@/spamassassin/compiled/@@VERSION@@
+
+If the updates should be stored in another location, specify it here.
+
+Note that use of this option is not recommended; if sa-compile is placing the
+compiled rules the wrong directory, you probably need to rebuild SpamAssassin
+with different C<Makefile.PL> arguments, instead of overriding sa-compile's
+runtime behaviour.
 
 =item B<--cf='config line'>