From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Sep 23 08: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 86F601065695 for ; Thu, 23 Sep 2010 08: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 4A2978FC27 for ; Thu, 23 Sep 2010 08: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 o8N8A2BQ025242 for ; Thu, 23 Sep 2010 08:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8N8A2tx025241; Thu, 23 Sep 2010 08:10:02 GMT (envelope-from gnats) Resent-Date: Thu, 23 Sep 2010 08:10:02 GMT Resent-Message-Id: <201009230810.o8N8A2tx025241@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, Martin Matuska Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EDE2106566C; Thu, 23 Sep 2010 08:05:47 +0000 (UTC) (envelope-from mm@mail2.vx.sk) Received: from mail2.vx.sk (mail2.vx.sk [IPv6:2a01:4f8:100:84a3::3]) by mx1.freebsd.org (Postfix) with ESMTP id AA7FF8FC1F; Thu, 23 Sep 2010 08:05:46 +0000 (UTC) Received: from neo.vx.sk (localhost [127.0.0.1]) by mail2.vx.sk (Postfix) with ESMTP id 9F362E51C0; Thu, 23 Sep 2010 10:05:44 +0200 (CEST) Received: from mail2.vx.sk ([127.0.0.1]) by neo.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uGw4VUD4H2ph; Thu, 23 Sep 2010 10:05:33 +0200 (CEST) Received: by mail2.vx.sk (Postfix, from userid 1001) id 66BD4E51BB; Thu, 23 Sep 2010 10:05:33 +0200 (CEST) Message-Id: <20100923080533.66BD4E51BB@mail2.vx.sk> Date: Thu, 23 Sep 2010 10:05:33 +0200 (CEST) From: Martin Matuska To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: skv@FreeBSD.org Subject: ports/150876: [PATCH] lang/perl: fix perl bug #74404 (h2ph warnings) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 08:10:02 -0000 >Number: 150876 >Category: ports >Synopsis: [PATCH] lang/perl: fix perl bug #74404 (h2ph warnings) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Sep 23 08:10:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Martin Matuska >Release: FreeBSD 8.1-STABLE amd64 >Organization: >Environment: System: FreeBSD neo.vx.sk 8.1-STABLE FreeBSD 8.1-STABLE #1 r212768M: Fri Sep 17 00:01:06 CEST >Description: Add patch to fix h2ph deprecated goto (perl bug #74404) Perl Git commits: f178b03ba25ce69b2031fa5b9fabbb5c69482ad2 112a1457c05eac6b69395fa04d5d1fdca4a73702 Perl Bug: http://rt.perl.org/rt3/Public/Bug/Display.html?id=74404 Added file(s): - files/patch-h2ph Port maintainer (skv@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: >Fix: --- perl-5.12.2_2.patch begins here --- Index: files/patch-h2ph =================================================================== RCS file: files/patch-h2ph diff -N files/patch-h2ph --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-h2ph 23 Sep 2010 08:02:12 -0000 @@ -0,0 +1,136 @@ +diff --git a/lib/h2ph.t b/lib/h2ph.t +index 8d62d46..2b58f6a 100644 +--- a/lib/h2ph.t ++++ lib/h2ph.t +@@ -18,7 +18,7 @@ if (!(-e $extracted_program)) { + exit 0; + } + +-plan(4); ++plan(5); + + # quickly compare two text files + sub txt_compare { +@@ -28,16 +28,18 @@ sub txt_compare { + $A cmp $B; + } + +-my $result = runperl( progfile => $extracted_program, ++my $result = runperl( progfile => $extracted_program, ++ stderr => 1, + args => ['-d.', '-Q', 'lib/h2ph.h']); ++is( $result, '', "output is free of warnings" ); + is( $?, 0, "$extracted_program runs successfully" ); +- +-is ( txt_compare("lib/h2ph.ph", "lib/h2ph.pht"), ++ ++is ( txt_compare("lib/h2ph.ph", "lib/h2ph.pht"), + 0, + "generated file has expected contents" ); +- +-$result = runperl( progfile => 'lib/h2ph.pht', +- switches => ['-c'], ++ ++$result = runperl( progfile => 'lib/h2ph.pht', ++ switches => ['-c'], + stderr => 1 ); + like( $result, qr/syntax OK$/, "output compiles"); + +diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h +index 78429ca..8026394 100644 +--- a/t/lib/h2ph.h ++++ t/lib/h2ph.h +@@ -132,6 +132,11 @@ enum flimflam { + flam + } flamflim; + ++static __inline__ int blli_in_use(struct atm_blli blli) ++{ ++ return blli.l2_proto || blli.l3_proto; ++} ++ + /* Handle multi-line quoted strings: */ + __asm__ __volatile__(" + this +diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht +index cda8d21..f068d6d 100644 +--- a/t/lib/h2ph.pht ++++ t/lib/h2ph.pht +@@ -90,6 +90,10 @@ unless(defined(&_H2PH_H_)) { + } + eval("sub flim () { 0; }") unless defined(&flim); + eval("sub flam () { 1; }") unless defined(&flam); ++ eval 'sub blli_in_use { ++ my($blli) = @_; ++ eval q({ ($blli->{l2_proto}) || ($blli->{l3_proto}); }); ++ }' unless defined(&blli_in_use); + eval 'sub multiline () {"multilinestring";}' unless defined(&multiline); + } + 1; +diff --git a/utils/h2ph.PL b/utils/h2ph.PL +index 1255807..2228e1b 100644 +--- a/utils/h2ph.PL ++++ utils/h2ph.PL +@@ -147,23 +147,7 @@ while (defined (my $file = next_file())) { + s/^\s+//; + expr(); + $new =~ s/(["\\])/\\$1/g; #"]); +- EMIT: +- $new = reindent($new); +- $args = reindent($args); +- if ($t ne '') { +- $new =~ s/(['\\])/\\$1/g; #']); +- if ($opt_h) { +- print OUT $t, +- "eval \"\\n#line $eval_index $outfile\\n\" . 'sub $name $proto\{\n$t ${args}eval q($new);\n$t}' unless defined(\&$name);\n"; +- $eval_index++; +- } else { +- print OUT $t, +- "eval 'sub $name $proto\{\n$t ${args}eval q($new);\n$t}' unless defined(\&$name);\n"; +- } +- } else { +- print OUT "unless(defined(\&$name)) {\n sub $name $proto\{\n\t${args}eval q($new);\n }\n}\n"; +- } +- %curargs = (); ++ EMIT($proto); + } else { + s/^\s+//; + expr(); +@@ -380,7 +364,7 @@ while (defined (my $file = next_file())) { + $new =~ s/&$_\b/\$$_/g for @local_variables; + $new =~ s/(["\\])/\\$1/g; #"]); + # now that's almost like a macro (we hope) +- goto EMIT; ++ EMIT($proto); + } + } + $Is_converted{$file} = 1; +@@ -400,6 +384,28 @@ if ($opt_e && (scalar(keys %bad_file) > 0)) { + + exit $Exit; + ++sub EMIT { ++ my $proto = shift; ++ ++ $new = reindent($new); ++ $args = reindent($args); ++ if ($t ne '') { ++ $new =~ s/(['\\])/\\$1/g; #']); ++ if ($opt_h) { ++ print OUT $t, ++ "eval \"\\n#line $eval_index $outfile\\n\" . 'sub $name $proto\{\n$t ${args}eval q($new);\n$t}' unless defined(\&$name);\n"; ++ $eval_index++; ++ } else { ++ print OUT $t, ++ "eval 'sub $name $proto\{\n$t ${args}eval q($new);\n$t}' unless defined(\&$name);\n"; ++ } ++ } else { ++ print OUT "unless(defined(\&$name)) {\n sub $name $proto\{\n\t${args}eval q($new);\n }\n}\n"; ++ } ++ %curargs = (); ++ return; ++} ++ + sub expr { + if (/\b__asm__\b/) { # freak out + $new = '"(assembly code)"'; --- perl-5.12.2_2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: