From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Aug 12 09:10:02 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3055E10656AB for ; Thu, 12 Aug 2010 09:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 081EF8FC22 for ; Thu, 12 Aug 2010 09:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7C9A1TG027688 for ; Thu, 12 Aug 2010 09:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7C9A1EM027687; Thu, 12 Aug 2010 09:10:01 GMT (envelope-from gnats) Resent-Date: Thu, 12 Aug 2010 09:10:01 GMT Resent-Message-Id: <201008120910.o7C9A1EM027687@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, takefu@airport.fm Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1CE3106567C for ; Thu, 12 Aug 2010 08:38:03 +0000 (UTC) (envelope-from takefu@airport.fm) Received: from ae-osaka.co.jp (unknown [IPv6:2001:3e0:4ec:a000::1]) by mx1.freebsd.org (Postfix) with ESMTP id 545A18FC15 for ; Thu, 12 Aug 2010 08:38:03 +0000 (UTC) Received: from ae-osaka.co.jp (localhost.ae-osaka.co.jp [127.0.0.1]) by ae-osaka.co.jp (Postfix) with ESMTP id 035D311472 for ; Thu, 12 Aug 2010 17:38:02 +0900 (JST) Received: from ae-osaka.co.jp ([127.0.0.1]) by ae-osaka.co.jp (ae-osaka.co.jp [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X5c5BfH6CQrb for ; Thu, 12 Aug 2010 17:38:01 +0900 (JST) Received: from [IPv6:2001:3e0:4ec:a011:fc31:bdeb:4324:3ca3] (unknown [IPv6:2001:3e0:4ec:a011:fc31:bdeb:4324:3ca3]) by ae-osaka.co.jp (Postfix) with ESMTPSA id 83CA811471 for ; Thu, 12 Aug 2010 17:37:54 +0900 (JST) Message-Id: <4C63B2E1.6050802@airport.fm> Date: Thu, 12 Aug 2010 17:37:53 +0900 From: Takefu To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: ports/149561: [PATCH] mail/p5-Mail-SpamAssassin Test suite fails with perl 5.12.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: takefu@airport.fm List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 09:10:02 -0000 >Number: 149561 >Category: ports >Synopsis: mail/p5-Mail-SpamAssassin Test suite fails with perl 5.12.0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 12 09:10:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Takefu >Release: >Organization: FOX Amateur Radio Club >Environment: >Description: lang/perl5.12 problems occur in combination. https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6392 >How-To-Repeat: >Fix: --- p5-Mail-SpamAssassin.diff begins here --- diff -ruN /usr/ports/mail/p5-Mail-SpamAssassin/Makefile mail/p5-Mail-SpamAssassin/Makefile --- /usr/ports/mail/p5-Mail-SpamAssassin/Makefile 2010-08-12 17:01:00.000000000 +0900 +++ mail/p5-Mail-SpamAssassin/Makefile 2010-08-12 17:14:58.000000000 +0900 @@ -7,6 +7,7 @@ PORTNAME= Mail-SpamAssassin PORTVERSION= 3.3.1 +PORTREVISION= 1 CATEGORIES= mail perl5 MASTER_SITES= ${MASTER_SITE_APACHE:S/$/:apache/} ${MASTER_SITE_PERL_CPAN:S/$/:cpan/} MASTER_SITE_SUBDIR= spamassassin/source/:apache Mail/:cpan @@ -28,8 +29,7 @@ ${SITE_PERL}/${PERL_ARCH}/Encode/Detect.pm:${PORTSDIR}/converters/p5-Encode-Detect \ ${SITE_PERL}/Mail/Internet.pm:${PORTSDIR}/mail/p5-Mail-Tools -RUN_DEPENDS= ${BUILD_DEPENDS} \ - ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes +RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes CONFLICTS= ja-p5-Mail-SpamAssassin-[0-9]* diff -ruN /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-Dns.pm mail/p5-Mail-SpamAssassin/files/patch-Dns.pm --- /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-Dns.pm 1970-01-01 09:00:00.000000000 +0900 +++ mail/p5-Mail-SpamAssassin/files/patch-Dns.pm 2010-07-28 11:13:57.000000000 +0900 @@ -0,0 +1,11 @@ +--- lib/Mail/SpamAssassin/Dns.pm 2010/03/16 14:43:51 923775 ++++ lib/Mail/SpamAssassin/Dns.pm 2010/05/13 16:47:08 943933 +@@ -754,7 +754,7 @@ + dbg("dns: entering helper-app run mode"); + $self->{old_slash} = $/; # Razor pollutes this + %{$self->{old_env}} = (); +- if ( defined %ENV ) { ++ if ( %ENV ) { + # undefined values in %ENV can result due to autovivification elsewhere, + # this prevents later possible warnings when we restore %ENV + while (my ($key, $value) = each %ENV) { diff -ruN /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-HTML.pm mail/p5-Mail-SpamAssassin/files/patch-HTML.pm --- /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-HTML.pm 1970-01-01 09:00:00.000000000 +0900 +++ mail/p5-Mail-SpamAssassin/files/patch-HTML.pm 2010-07-28 11:14:10.000000000 +0900 @@ -0,0 +1,11 @@ +--- lib/Mail/SpamAssassin/HTML.pm 2010/03/16 14:43:51 923775 ++++ lib/Mail/SpamAssassin/HTML.pm 2010/05/13 16:47:08 943933 +@@ -191,7 +191,7 @@ + my $self = shift; + my %options = @_; + +- return join('', @{ $self->{text} }) unless keys %options; ++ return join('', @{ $self->{text} }) unless %options; + + my $mask; + while (my ($k, $v) = each %options) { diff -ruN /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-Plugin-BodyEval.pm mail/p5-Mail-SpamAssassin/files/patch-Plugin-BodyEval.pm --- /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-Plugin-BodyEval.pm 1970-01-01 09:00:00.000000000 +0900 +++ mail/p5-Mail-SpamAssassin/files/patch-Plugin-BodyEval.pm 2010-07-28 11:14:27.000000000 +0900 @@ -0,0 +1,11 @@ +--- lib/Mail/SpamAssassin/Plugin/BodyEval.pm 2010/03/16 14:43:51 923775 ++++ lib/Mail/SpamAssassin/Plugin/BodyEval.pm 2010/05/13 16:47:08 943933 +@@ -119,7 +119,7 @@ + } + + # If there are no words, mark if there's at least 1 image ... +- if (keys %html == 0 && exists $pms->{html}{inside}{img}) { ++ if (!%html && exists $pms->{html}{inside}{img}) { + # Use "\n" as the mark since it can't ever occur normally + $html{"\n"}=1; + } diff -ruN /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-Plugin-Check.pm mail/p5-Mail-SpamAssassin/files/patch-Plugin-Check.pm --- /usr/ports/mail/p5-Mail-SpamAssassin/files/patch-Plugin-Check.pm 1970-01-01 09:00:00.000000000 +0900 +++ mail/p5-Mail-SpamAssassin/files/patch-Plugin-Check.pm 2010-07-28 11:14:42.000000000 +0900 @@ -0,0 +1,185 @@ +--- lib/Mail/SpamAssassin/Plugin/Check.pm 2010/03/16 14:43:51 923775 ++++ lib/Mail/SpamAssassin/Plugin/Check.pm 2010/05/13 16:47:08 943933 +@@ -307,64 +307,51 @@ + my $package_name = __PACKAGE__; + my $methodname = $package_name."::_".$ruletype."_tests_".$clean_priority; + +- if (defined &{$methodname} && !$doing_user_rules) { +-run_compiled_method: +- # dbg("rules: run_generic_tests - calling %s", $methodname); +- my $t = Mail::SpamAssassin::Timeout->new({ deadline => $master_deadline }); +- my $err = $t->run(sub { +- no strict "refs"; +- $methodname->($pms, @{$opts{args}}); +- }); +- if ($t->timed_out() && $master_deadline && time > $master_deadline) { +- info("check: exceeded time limit in $methodname, skipping further tests"); +- $pms->{deadline_exceeded} = 1; +- } +- return; +- } ++ if (!defined &{$methodname} || $doing_user_rules) { + +- # use %nopts for named parameter-passing; it's more friendly to future-proof +- # subclassing, since new parameters can be added without breaking third-party +- # subclassed implementations of this plugin. +- my %nopts = ( +- ruletype => $ruletype, +- doing_user_rules => $doing_user_rules, +- priority => $priority, +- clean_priority => $clean_priority +- ); ++ # use %nopts for named parameter-passing; it's more friendly ++ # to future-proof subclassing, since new parameters can be added without ++ # breaking third-party subclassed implementations of this plugin. ++ my %nopts = ( ++ ruletype => $ruletype, ++ doing_user_rules => $doing_user_rules, ++ priority => $priority, ++ clean_priority => $clean_priority ++ ); ++ ++ # build up the eval string... ++ $self->{evalstr_methodname} = $methodname; ++ $self->{evalstr_chunk_current_methodname} = undef; ++ $self->{evalstr_chunk_methodnames} = []; ++ $self->{evalstr_chunk_prefix} = []; # stack (array) of source code sections ++ $self->{evalstr} = ''; $self->{evalstr_l} = 0; ++ $self->{evalstr2} = ''; ++ $self->begin_evalstr_chunk($pms); + +- # build up the eval string... +- $self->{evalstr_methodname} = $methodname; +- $self->{evalstr_chunk_current_methodname} = undef; +- $self->{evalstr_chunk_methodnames} = []; +- $self->{evalstr_chunk_prefix} = []; # stack (array) of source code sections +- $self->{evalstr} = ''; $self->{evalstr_l} = 0; +- $self->{evalstr2} = ''; +- $self->begin_evalstr_chunk($pms); +- +- $self->push_evalstr_prefix($pms, ' +- # start_rules_plugin_code '.$ruletype.' '.$priority.' +- my $scoresptr = $self->{conf}->{scores}; +- '); +- if (defined $opts{pre_loop_body}) { +- $opts{pre_loop_body}->($self, $pms, $conf, %nopts); +- } +- $self->add_evalstr($pms, +- $self->start_rules_plugin_code($ruletype, $priority) ); +- while (my($rulename, $test) = each %{$opts{testhash}->{$priority}}) { +- $opts{loop_body}->($self, $pms, $conf, $rulename, $test, %nopts); +- } +- if (defined $opts{post_loop_body}) { +- $opts{post_loop_body}->($self, $pms, $conf, %nopts); +- } ++ $self->push_evalstr_prefix($pms, ' ++ # start_rules_plugin_code '.$ruletype.' '.$priority.' ++ my $scoresptr = $self->{conf}->{scores}; ++ '); ++ if (defined $opts{pre_loop_body}) { ++ $opts{pre_loop_body}->($self, $pms, $conf, %nopts); ++ } ++ $self->add_evalstr($pms, ++ $self->start_rules_plugin_code($ruletype, $priority) ); ++ while (my($rulename, $test) = each %{$opts{testhash}->{$priority}}) { ++ $opts{loop_body}->($self, $pms, $conf, $rulename, $test, %nopts); ++ } ++ if (defined $opts{post_loop_body}) { ++ $opts{post_loop_body}->($self, $pms, $conf, %nopts); ++ } + +- $self->flush_evalstr($pms, 'run_generic_tests'); +- $self->free_ruleset_source($pms, $ruletype, $priority); ++ $self->flush_evalstr($pms, 'run_generic_tests'); ++ $self->free_ruleset_source($pms, $ruletype, $priority); + +- # clear out a previous version of this method +- undef &{$methodname}; ++ # clear out a previous version of this method ++ undef &{$methodname}; + +- # generate the loop that goes through each line... +- my $evalstr = <<"EOT"; ++ # generate the loop that goes through each line... ++ my $evalstr = <<"EOT"; + { + package $package_name; + +@@ -373,40 +360,51 @@ + sub $methodname { + EOT + +- for my $chunk_methodname (@{$self->{evalstr_chunk_methodnames}}) { +- $evalstr .= " $chunk_methodname(\@_);\n"; +- } ++ for my $chunk_methodname (@{$self->{evalstr_chunk_methodnames}}) { ++ $evalstr .= " $chunk_methodname(\@_);\n"; ++ } + +- $evalstr .= <<"EOT"; ++ $evalstr .= <<"EOT"; + } + + 1; + } + EOT + +- delete $self->{evalstr}; # free up some RAM before we eval() +- delete $self->{evalstr2}; +- delete $self->{evalstr_methodname}; +- delete $self->{evalstr_chunk_current_methodname}; +- delete $self->{evalstr_chunk_methodnames}; +- delete $self->{evalstr_chunk_prefix}; +- +- dbg("rules: run_generic_tests - compiling eval code: %s, priority %s", +- $ruletype, $priority); +-# dbg("rules: eval code to compile: $evalstr"); +- my $eval_result; +- { my $timer = $self->{main}->time_method('compile_gen'); +- $eval_result = eval($evalstr); +- } +- if (!$eval_result) { +- my $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat; +- warn "rules: failed to compile $ruletype tests, skipping:\n". +- "\t($eval_stat)\n"; +- $pms->{rule_errors}++; +- } +- else { ++ delete $self->{evalstr}; # free up some RAM before we eval() ++ delete $self->{evalstr2}; ++ delete $self->{evalstr_methodname}; ++ delete $self->{evalstr_chunk_current_methodname}; ++ delete $self->{evalstr_chunk_methodnames}; ++ delete $self->{evalstr_chunk_prefix}; ++ ++ dbg("rules: run_generic_tests - compiling eval code: %s, priority %s", ++ $ruletype, $priority); ++ # dbg("rules: eval code to compile: $evalstr"); ++ my $eval_result; ++ { my $timer = $self->{main}->time_method('compile_gen'); ++ $eval_result = eval($evalstr); ++ } ++ if (!$eval_result) { ++ my $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat; ++ warn "rules: failed to compile $ruletype tests, skipping:\n". ++ "\t($eval_stat)\n"; ++ $pms->{rule_errors}++; ++ return; ++ } + dbg("rules: compiled $ruletype tests"); +- goto run_compiled_method; ++ } ++ ++#run_compiled_method: ++# dbg("rules: run_generic_tests - calling %s", $methodname); ++ my $t = Mail::SpamAssassin::Timeout->new({ deadline => $master_deadline }); ++ my $err = $t->run(sub { ++ no strict "refs"; ++ $methodname->($pms, @{$opts{args}}); ++ }); ++ if ($t->timed_out() && $master_deadline && time > $master_deadline) { ++ info("check: exceeded time limit in $methodname, skipping further tests"); ++ $pms->{deadline_exceeded} = 1; + } + } + --- p5-Mail-SpamAssassin.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: