Mailing List Archive

svn commit: rev 6745 - in incubator/spamassassin/trunk: . lib/Mail/SpamAssassin
Author: felicity
Date: Wed Feb 18 17:03:15 2004
New Revision: 6745

Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/CmdLearn.pm
incubator/spamassassin/trunk/sa-learn.raw
Log:
bug 3014: allow dbpath for everything, not just dump and import

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/CmdLearn.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/CmdLearn.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/CmdLearn.pm Wed Feb 18 17:03:15 2004
@@ -126,9 +126,17 @@

$spamtest->init (1);

- # Add a default prefix if the path is a directory
- if (defined $bayes_override_path && -d $bayes_override_path) {
- $bayes_override_path = File::Spec->catfile($bayes_override_path, 'bayes');
+ # kluge to support old check_bayes_db operation
+ if ( defined $bayes_override_path ) {
+ # Add a default prefix if the path is a directory
+ if (-d $bayes_override_path) {
+ $bayes_override_path = File::Spec->catfile($bayes_override_path, 'bayes');
+ }
+
+ # init() above ties to the db r/o and leaves it that way
+ # so we need to untie before dumping (it'll reopen)
+ $spamtest->finish_learner();
+ $spamtest->{conf}->{bayes_path} = $bayes_override_path;
}

if (defined $opt{'dump'}) {
@@ -149,27 +157,12 @@
return 1;
}

- # kluge to support old check_bayes_db operation
- if ( defined $bayes_override_path ) {
- # init() above ties to the db r/o and leaves it that way
- # so we need to untie before dumping (it'll reopen)
- $spamtest->finish_learner();
- $spamtest->{conf}->{bayes_path} = $bayes_override_path;
- }
-
$spamtest->dump_bayes_db($magic, $toks, $opt{'regexp'});
$spamtest->finish_learner();
return 0;
}

if (defined $opt{'import'}) {
- if ( defined $bayes_override_path ) {
- # init() above ties to the db r/o and leaves it that way
- # so we need to untie before dumping (it'll reopen)
- $spamtest->finish_learner();
- $spamtest->{conf}->{bayes_path} = $bayes_override_path;
- }
-
my $ret = $spamtest->{bayes_scanner}->{store}->perform_upgrade();
$spamtest->finish_learner();
return (!$ret);

Modified: incubator/spamassassin/trunk/sa-learn.raw
==============================================================================
--- incubator/spamassassin/trunk/sa-learn.raw (original)
+++ incubator/spamassassin/trunk/sa-learn.raw Wed Feb 18 17:03:15 2004
@@ -78,10 +78,10 @@
--forget Forget a message
--rebuild Rebuild the database if needed
--force-expire Force an expiry run, rebuild every time
+ --dbpath <path> Allows commandline override (in bayes_path form)
+ for where to read the Bayes DB from
--dump [all|data|magic] Display the contents of the Bayes database
Takes optional argument for what to display
- --dbpath <path> For dump/import only, specifies (in bayes_path form)
- where to read the Bayes DB from
--regexp <re> For dump only, specifies which tokens to
dump based on a regular expression.
-f file, --folders=file Read list of files/directories from file
@@ -351,15 +351,16 @@

Forget a given message previously learnt.

+=item B<--dbpath>
+
+Allows a commandline override of the I<bayes_path> configuration option.
+
=item B<--dump> I<option>

Display the contents of the Bayes database. Without an option or with
the I<all> option, all magic tokens and data tokens will be displayed.
I<magic> will only display magic tokens, and I<data> will only display
the data tokens.
-
-Can also use the B<--dbpath> I<path> option to specify the location of
-the Bayes files to use.

Can also use the B<--regexp> I<RE> option to specify which tokens to
display based on a regular expression.