- fix generated .ph files so that they no longer cause warnings (#509676)

- remove PREREQ_FATAL from Makefile.PL's processed by miniperl
- update to latest Scalar-List-Utils (#507378)
- perl-skip-prereq.patch: skip more prereq declarations in Makefile.PL
    files
This commit is contained in:
Štěpán Kasal 2009-07-10 18:38:10 +00:00
parent 0844fc3b68
commit 8a4bfbfef9
4 changed files with 1709 additions and 3 deletions

141
perl-bz509676.patch Normal file
View File

@ -0,0 +1,141 @@
commit 345d607e7958b7f31d5f0c780e86d1cc3e658d99
Author: Niko Tyni <ntyni@debian.org>
Date: Tue Apr 14 22:55:34 2009 +0300
Squelch 'Constant subroutine ... undefined' warnings from .ph files
As reported by Christopher Zimmermann in <http://bugs.debian.org/379757>,
code generated from simple #undef directives by h2ph can cause
'Constant subroutine ... undefined' warnings if the undefined
function was eligible for inlining.
(cherry picked from commit c0cc52e96e988526754ef533bd76595720660db2)
commit 2d375d52dd1895b26a80209dd64a3c11b9e3b532
Author: Niko Tyni <ntyni@debian.org>
Date: Tue Apr 14 22:55:33 2009 +0300
Add tests to verify that h2ph output compiles and is warning free
The #include directives are #ifdef'd out so that running the
resulting code does not actually need the headers. We still
get the same effect from comparing with the expected h2ph output.
(cherry picked from commit c1a2df7619e7315b8fccef3b9fa56bb8d7df3845)
diff --git a/lib/h2ph.t b/lib/h2ph.t
index 7b339b3..e303406 100755
--- a/lib/h2ph.t
+++ b/lib/h2ph.t
@@ -15,7 +15,7 @@ if (!(-e $extracted_program)) {
exit 0;
}
-print "1..2\n";
+print "1..4\n";
# quickly compare two text files
sub txt_compare {
@@ -32,6 +32,14 @@ print(($ok == 0 ? "" : "not "), "ok 1\n");
$ok = txt_compare("lib/h2ph.ph", "lib/h2ph.pht");
print(($ok == 0 ? "" : "not "), "ok 2\n");
+# does the output compile?
+$ok = system($^X, "-I../lib", "lib/h2ph.pht");
+print(($ok == 0 ? "" : "not "), "ok 3\n");
+
+# is the output warning free?
+$ok = system($^X, "-w", "-I../lib", "-e", '$SIG{__WARN__} = sub { die $_[0] }; require "lib/h2ph.pht"');
+print(($ok == 0 ? "" : "not "), "ok 4\n");
+
# cleanup - should this be in an END block?
unlink("lib/h2ph.ph");
unlink("_h2ph_pre.ph");
diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h
index 495789a..78429ca 100644
--- a/t/lib/h2ph.h
+++ b/t/lib/h2ph.h
@@ -26,6 +26,10 @@
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
+/* Test #undef'ining an existing constant function */
+#define NOTTRUE 0
+#undef NOTTRUE
+
/* Test #ifdef */
#ifdef __SOME_UNIMPORTANT_PROPERTY
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -68,9 +72,11 @@ function Tru64_Pascal(n: Integer): Integer;
* with `use lib qw(/opt/perl5/lib/site_perl/i586-linux/linux);' or whatever
* your equivalent is...
*/
+#if 0
#include <sys/socket.h>
#import "sys/ioctl.h"
#include_next <sys/fcntl.h>
+#endif
/* typedefs should be ignored */
typedef struct a_struct {
diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht
index 145e682..3723fca 100644
--- a/t/lib/h2ph.pht
+++ b/t/lib/h2ph.pht
@@ -1,6 +1,6 @@
require '_h2ph_pre.ph';
-no warnings 'redefine';
+no warnings qw(redefine misc);
unless(defined(&SQUARE)) {
sub SQUARE {
@@ -22,6 +22,8 @@ unless(defined(&_H2PH_H_)) {
my($a,$b) = @_;
eval q((($a) > ($b) ? ($a) : ($b)));
}' unless defined(&MAX);
+ eval 'sub NOTTRUE () {0;}' unless defined(&NOTTRUE);
+ undef(&NOTTRUE) if defined(&NOTTRUE);
if(defined(&__SOME_UNIMPORTANT_PROPERTY)) {
eval 'sub MIN {
my($a,$b) = @_;
@@ -47,15 +49,17 @@ unless(defined(&_H2PH_H_)) {
} else {
eval 'sub WHATEVER () {1000;}' unless defined(&WHATEVER);
}
- require 'sys/socket.ph';
- require 'sys/ioctl.ph';
- eval {
- my(@REM);
- my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
- @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
- require "$REM[0]" if @REM;
- };
- warn($@) if $@;
+ if(0) {
+ require 'sys/socket.ph';
+ require 'sys/ioctl.ph';
+ eval {
+ my(@REM);
+ my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
+ @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
+ require "$REM[0]" if @REM;
+ };
+ warn($@) if $@;
+ }
eval("sub sun () { 0; }") unless defined(&sun);
eval("sub mon () { 1; }") unless defined(&mon);
eval("sub tue () { 2; }") unless defined(&tue);
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 6f40126..4e99a7a 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -123,7 +123,7 @@ while (defined (my $file = next_file())) {
print OUT
"require '_h2ph_pre.ph';\n\n",
- "no warnings 'redefine';\n\n";
+ "no warnings qw(redefine misc);\n\n";
while (defined (local $_ = next_line($file))) {
if (s/^\s*\#\s*//) {

24
perl-skip-prereq.patch Normal file
View File

@ -0,0 +1,24 @@
--- perl-5.10.0/ext/Math/BigInt/FastCalc/Makefile.PL 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/Math/BigInt/FastCalc/Makefile.PL 2009-07-10 15:37:39.000000000 +0200
@@ -2,12 +2,18 @@
use strict;
+unless($ENV{PERL_CORE}) {
+ $ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
+}
+
WriteMakefile(
'NAME' => 'Math::BigInt::FastCalc',
'VERSION_FROM' => 'FastCalc.pm',
- 'PREREQ_PM' => {
- 'Math::BigInt' => 1.88,
- },
+ (
+ $ENV{PERL_CORE}
+ ? ( )
+ : ('PREREQ_PM' => { 'Math::BigInt' => 1.88, } )
+ ),
INSTALLDIRS => 'perl',
PREREQ_FATAL => 1,
MAN3PODS => {},

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
Name: perl
Version: %{perl_version}
Release: 73%{?dist}
Release: 74%{?dist}
Epoch: %{perl_epoch}
Summary: Practical Extraction and Report Language
Group: Development/Languages
@ -184,6 +184,13 @@ Patch57: 38_fix_weaken_memleak
# http://rt.perl.org/rt3/Ticket/Display.html?id=39060 (#221113)
Patch58: perl-perlio-incorrect-errno.patch
# h2ph: generated *.ph files no longer produce warnings when processed
Patch59: perl-bz509676.patch
# With the Scalar-List-Utils update, more prereq declarations have to
# be skipped in Makefile.PL files.
Patch60: perl-skip-prereq.patch
# Update some of the bundled modules
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
Patch100: perl-update-constant.patch
@ -229,9 +236,11 @@ Patch118: perl-update-autodie.patch
%define autodie_version 1.999
# cpan has it under PathTools-3.30
Patch119: perl-update-FileSpec.patch
%define File_Spec_version 3.30
%define File_Spec_version 3.30
Patch120: perl-update-Compress_Raw_Zlib.patch
%define Compress_Raw_Zlib 2.020
%define Compress_Raw_Zlib 2.020
Patch121: perl-update-Scalar-List-Utils.patch
%define Scalar_List_Utils 1.21
# Fedora uses links instead of lynx
# patches File-Fetch and CPAN
@ -987,6 +996,8 @@ upstream tarball from perl.org.
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch100 -p1
%patch101 -p1
@ -1009,6 +1020,7 @@ upstream tarball from perl.org.
%patch118 -p1
%patch119 -p1
%patch120 -p1
%patch121 -p1
%patch201 -p1
#
@ -1256,6 +1268,8 @@ perl -x patchlevel.h \
'Fedora Patch56: Fix $? when dumping core' \
'34209 Fix a memory leak with Scalar::Util::weaken()' \
'fix RT 39060, errno incorrectly set in perlio' \
'Fedora Patch59: h2ph: generated *.ph files no longer produce warnings when processed' \
'Fedora Patch60: remove PREREQ_FATAL from Makefile.PLs processed by miniperl' \
'Fedora Patch100: Update module constant to %{constant_version}' \
'Fedora Patch101: Update Archive::Extract to %{Archive_Extract_version}' \
'Fedora Patch102: Update Archive::Tar to %{Archive_Tar_version}' \
@ -1277,6 +1291,7 @@ perl -x patchlevel.h \
'Fedora Patch117: Update module autodie to %{autodie_version}' \
'Fedora Patch119: Update File::Spec to %{File_Spec_version}' \
'Fedora Patch120: Update Compress::Raw::Zlib to %{Compress_Raw_Zlib}' \
'Fedora Patch121: Update Scalar-List-Utils to %{Scalar_List_Utils}' \
'Fedora Patch201: Fedora uses links instead of lynx' \
%{nil}
@ -1902,6 +1917,12 @@ TMPDIR="$PWD/tmp" make test
# Old changelog entries are preserved in CVS.
%changelog
* Fri Jul 10 2009 Stepan Kasal <skasal@redhat.com> - 4:5.10.0-74
- fix generated .ph files so that they no longer cause warnings (#509676)
- remove PREREQ_FATAL from Makefile.PL's processed by miniperl
- update to latest Scalar-List-Utils (#507378)
- perl-skip-prereq.patch: skip more prereq declarations in Makefile.PL files
* Tue Jul 7 2009 Stepan Kasal <skasal@redhat.com> - 4:5.10.0-73
- re-enable tests