http://bugzilla.spamassassin.org/show_bug.cgi?id=4330
------- Additional Comments From [EMAIL PROTECTED] 2005-05-13 17:05 -------
Subject: Re: Conf::clone() is broken
On Fri, May 13, 2005 at 01:46:43PM -0700, [EMAIL PROTECTED] wrote:
> $self->{conf} = $source->{obj}->clone();
>
> It just overwrites the conf variable, which ends up setting all the code
> references to undef.
I committed r170109 which rewrites that section of code to do the
"overwrite existing $conf" methodology and ignore, not undef, the code
references. This also means we don't have the conf parser resetup after
each message, etc.
So far it seems to have fixed my issue, and checks work, but ... I'm still
testing.
If anyone's curious, here's the script I'm using to check... I got to learn
that "$Data::Dumper::SortKeys = 1" messes up the internal counter for a hash
array's keys/values/each iterator. Hence the little "keys" hack to reset it.
#!/usr/bin/perl -w
use strict;
$|++;
use lib $ENV{'HOME'}.'/SA/spamassassin-head/lib';
use Mail::SpamAssassin;
use Data::Dumper;
$Data::Dumper::Sortkeys = 1; # makes diff work ...
my $sa = new Mail::SpamAssassin();
$sa->init(0);
delete $sa->{conf}->{main};
print Dumper($sa->{conf});
keys %{$sa->{conf}}; # hack due to SortKeys = 1 ...
my $foo = { };
$sa->copy_config(undef, $foo);
$sa->{conf}->{scoreset}->[3]->{'BAYES_00'} = -4040;
$sa->{conf}->{bayes_auto_learn} = 10101010;
$sa->{conf}->{scoreset_current} = 3;
$sa->{conf}->{uridnsbl_skip_domains}->{'kluge.net'} = 1;
delete $sa->{conf}->{uridnsbl_skip_domains}->{'aweber.com'};
$sa->copy_config($foo, undef);
warn Dumper($sa->{conf});
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.