Mailing List Archive

svn commit: rev 9739 - in incubator/spamassassin/trunk/lib/Mail: . SpamAssassin
Author: felicity
Date: Wed Mar 24 11:54:31 2004
New Revision: 9739

Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin.pm
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
Log:
due to cpan's 'issues' with x.y.z version numbers, our internal numbering scheme will be based on perl's (x.yyyzzz), and convert to x.y.z for display... also added coded, commented out for now, to allow 'require_version 3.0' to work for all 3.0.z versions.

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin.pm Wed Mar 24 11:54:31 2004
@@ -95,8 +95,8 @@
@site_rules_path
};

-$VERSION = "3.0.0"; # update after release
-$IS_DEVEL_BUILD = 1; # change for release versions
+$VERSION = "3.000000"; # update after release (same format as perl $])
+$IS_DEVEL_BUILD = 1; # change for release versions

@ISA = qw();

@@ -110,7 +110,7 @@
push(@EXTRA_VERSION, ( 'r' . qw{$LastChangedRevision$ updated by SVN}[1] ));
}

-sub Version { join('-', $VERSION, @EXTRA_VERSION) }
+sub Version { $VERSION=~/^(\d+)\.(\d\d\d)(\d\d\d)$/; join('-', sprintf("%d.%d.%d",$1,$2,$3), @EXTRA_VERSION) }

$HOME_URL = "http://spamassassin.org/";


Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Wed Mar 24 11:54:31 2004
@@ -612,18 +612,23 @@
=cut

if ( $key eq 'require_version' ) {
- my $req_version = $value;
- $req_version =~ s/^\@\@VERSION\@\@$/$Mail::SpamAssassin::VERSION/;
+ # if it wasn't replaced during install, assume current version ...
+ next if ($value eq "\@\@VERSION\@\@");

- # earlier versions used !=
- # starting with 3.0.0, perl doesn't like != so it was switched to ne
- # we should probably allow "require_version 3.0" be good for all
- # "3.0.x" versions - tvd
- #
- if ($Mail::SpamAssassin::VERSION ne $req_version) {
+ my $ver = $Mail::SpamAssassin::VERSION;
+
+ # if we want to allow "require_version 3.0" be good for all
+ # "3.0.x" versions:
+ ## make sure it's a numeric value
+ #$value += 0.0;
+ ## convert 3.000000 -> 3.0, stay backwards compatible ...
+ #$ver =~ s/^(\d+)\.(\d{1,3}).*$/sprintf "%d.%d", $1, $2/e;
+ #$value =~ s/^(\d+)\.(\d{1,3}).*$/sprintf "%d.%d", $1, $2/e;
+
+ if ($ver ne $value) {
warn "configuration file \"$self->{currentfile}\" requires version ".
- "$req_version of SpamAssassin, but this is code version ".
- "$Mail::SpamAssassin::VERSION. Maybe you need to use ".
+ "$value of SpamAssassin, but this is code version ".
+ "$ver. Maybe you need to use ".
"the -C switch, or remove the old config files? ".
"Skipping this file";
$skip_parsing = 1;