diff options
Diffstat (limited to 'meta/recipes-devtools/perl/perl/fixes')
26 files changed, 1486 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff b/meta/recipes-devtools/perl/perl/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff new file mode 100644 index 0000000000..011d66ae03 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff @@ -0,0 +1,44 @@ +From af80a2d91b13dff65a495663dd9bd68d7880b9fb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> +Date: Fri, 8 Jun 2018 11:45:40 +0100 +Subject: [PATCH] Remove existing files before overwriting them + +Archive should extract only the latest same-named entry. +Extracted regular file should not be writtent into existing block +device (or any other one). + +Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk> +Bug: https://rt.cpan.org/Ticket/Display.html?id=125523 +Bug-Debian: https://bugs.debian.org/900834 +Origin: upstream, https://github.com/jib/archive-tar-new/commit/ae65651eab053fc6dc4590dbb863a268215c1fc5 +Patch-Name: fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff + +--- + cpan/Archive-Tar/lib/Archive/Tar.pm | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/cpan/Archive-Tar/lib/Archive/Tar.pm b/cpan/Archive-Tar/lib/Archive/Tar.pm +index d63e586..4861ea7 100644 +--- a/cpan/Archive-Tar/lib/Archive/Tar.pm ++++ b/cpan/Archive-Tar/lib/Archive/Tar.pm +@@ -845,6 +845,20 @@ sub _extract_file { + return; + } + ++ ### If a file system already contains a block device with the same name as ++ ### the being extracted regular file, we would write the file's content ++ ### to the block device. So remove the existing file (block device) now. ++ ### If an archive contains multiple same-named entries, the last one ++ ### should replace the previous ones. So remove the old file now. ++ ### If the old entry is a symlink to a file outside of the CWD, the new ++ ### entry would create a file there. This is CVE-2018-12015 ++ ### <https://rt.cpan.org/Ticket/Display.html?id=125523>. ++ if (-l $full || -e _) { ++ if (!unlink $full) { ++ $self->_error( qq[Could not remove old file '$full': $!] ); ++ return; ++ } ++ } + if( length $entry->type && $entry->is_file ) { + my $fh = IO::File->new; + $fh->open( '>' . $full ) or ( diff --git a/meta/recipes-devtools/perl/perl/fixes/CVE-2018-6797-testcase.diff b/meta/recipes-devtools/perl/perl/fixes/CVE-2018-6797-testcase.diff new file mode 100644 index 0000000000..5f662dfb57 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/CVE-2018-6797-testcase.diff @@ -0,0 +1,33 @@ +From 0e201824c24919ad8f3570b15b0a3eab40166f8e Mon Sep 17 00:00:00 2001 +From: Karl Williamson <khw@cpan.org> +Date: Fri, 2 Feb 2018 15:14:27 -0700 +Subject: [PATCH] (perl #132227) restart a node if we change to uni rules + within the node and encounter a sharp S + +This could lead to a buffer overflow. + +Test case backported from the corresponding blead fix by Niko Tyni. + +Origin: backport +Bug: https://rt.perl.org/Public/Bug/Display.html?id=132227 +Patch-Name: fixes/CVE-2018-6797-testcase.diff + +--- + t/re/pat_advanced.t | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t +index 5e5cc1f..27df550 100644 +--- a/t/re/pat_advanced.t ++++ b/t/re/pat_advanced.t +@@ -2336,6 +2336,10 @@ EOF + unlike("s\N{U+DF}", qr/^\x{00DF}/i, "\"s\\N{U+DF}\", qr/^\\x{00DF}/i"); + } + ++ { # Bug #132227, caused failed assertion ++ ok(qr/0b\N{U+41}\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF/i, "No seqgfault [perl #132227]"); ++ } ++ + # User-defined Unicode properties to match above-Unicode code points + sub Is_32_Bit_Super { return "110000\tFFFFFFFF\n" } + sub Is_Portable_Super { return '!utf8::Any' } # Matches beyond 32 bits diff --git a/meta/recipes-devtools/perl/perl/fixes/autodie-scope.diff b/meta/recipes-devtools/perl/perl/fixes/autodie-scope.diff new file mode 100644 index 0000000000..2b03aa607c --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/autodie-scope.diff @@ -0,0 +1,100 @@ +From 5efa314e711b24e80ff36d5baa24f995ea07d359 Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +Date: Mon, 21 Dec 2015 19:20:12 +0200 +Subject: [PATCH] Fix a scoping issue with "no autodie" and the "system" sub + +Don't queue nonexisting subs for reinstalling later when +exiting the 'no autodie' scope. + +FIXME: if the original sub 'can be undef for "CORE::" subs', does this +break for those? Is that the case when $symbol =~ /::/, as guarded for +on L566? + +Bug: https://github.com/pjf/autodie/issues/69 +Bug-Debian: https://bugs.debian.org/798096 +Origin: upstream, https://github.com/pjf/autodie/commit/c1b4fc4a319f8139d1cd6770bfb7b72a59ae232d +Patch-Name: fixes/autodie-scope.diff + +--- + cpan/autodie/lib/Fatal.pm | 7 ++++++- + cpan/autodie/t/no-all.t | 22 ++++++++++++++++++++++ + cpan/autodie/t/no-default.t | 23 +++++++++++++++++++++++ + 3 files changed, 51 insertions(+), 1 deletion(-) + create mode 100755 cpan/autodie/t/no-all.t + create mode 100755 cpan/autodie/t/no-default.t + +diff --git a/cpan/autodie/lib/Fatal.pm b/cpan/autodie/lib/Fatal.pm +index 16e1743..2058abd 100644 +--- a/cpan/autodie/lib/Fatal.pm ++++ b/cpan/autodie/lib/Fatal.pm +@@ -580,7 +580,12 @@ sub unimport { + # Record the current sub to be reinstalled at end of scope + # and then restore the original (can be undef for "CORE::" + # subs) +- $reinstall_subs{$symbol} = \&$sub; ++ ++ { ++ no strict 'refs'; ++ $reinstall_subs{$symbol} = \&$sub ++ if exists ${"${pkg}::"}{$symbol}; ++ } + $uninstall_subs{$symbol} = $Original_user_sub{$sub}; + + } +diff --git a/cpan/autodie/t/no-all.t b/cpan/autodie/t/no-all.t +new file mode 100755 +index 0000000..1a503f6 +--- /dev/null ++++ b/cpan/autodie/t/no-all.t +@@ -0,0 +1,22 @@ ++#!/usr/bin/perl ++ ++package foo; ++use warnings; ++use strict; ++use Test::More tests => 1; ++use autodie qw(:all); ++ ++use_system(); ++ok("system() works with a lexical 'no autodie' block (github issue #69"); ++ ++sub break_system { ++ no autodie; ++ open(my $fh, "<", 'NONEXISTENT'); ++ ok("survived failing open"); ++} ++ ++sub use_system { ++ system($^X, '-e' , 1); ++} ++ ++1; +diff --git a/cpan/autodie/t/no-default.t b/cpan/autodie/t/no-default.t +new file mode 100755 +index 0000000..44d2acf +--- /dev/null ++++ b/cpan/autodie/t/no-default.t +@@ -0,0 +1,23 @@ ++#!/usr/bin/perl ++ ++package foo; ++use warnings; ++use strict; ++use Test::More tests => 2; ++use autodie; ++ ++ ++use_system(); ++ok("system() works with a lexical 'no autodie' block (github issue #69"); ++break_system(); ++ ++sub break_system { ++ no autodie; ++ open(my $fh, "<", 'NONEXISTENT'); ++ ok("survived failing open"); ++} ++ ++sub use_system { ++ system($^X, '-e' , 1); ++} ++1; diff --git a/meta/recipes-devtools/perl/perl/fixes/cpan_web_link.diff b/meta/recipes-devtools/perl/perl/fixes/cpan_web_link.diff new file mode 100644 index 0000000000..e5069e78ae --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/cpan_web_link.diff @@ -0,0 +1,27 @@ +From 531f0bae1b89e63b3c77b39e8cdbb85485735212 Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Sat, 30 Apr 2016 23:13:34 +0100 +Subject: [PATCH] CPAN: Add link to main CPAN web site + +Bug: https://github.com/andk/cpanpm/pull/96 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=367291 +Patch-Name: fixes/cpan_web_link.diff + +--- + cpan/CPAN/lib/CPAN.pm | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cpan/CPAN/lib/CPAN.pm b/cpan/CPAN/lib/CPAN.pm +index 4f02850..088cf61 100644 +--- a/cpan/CPAN/lib/CPAN.pm ++++ b/cpan/CPAN/lib/CPAN.pm +@@ -3981,6 +3981,9 @@ your operating system) then typing C<cpan> in a console window will + work for you as well. Above that the utility provides several + commandline shortcuts. + ++The main CPAN website, which includes general information about the ++service, is at L<http://www.cpan.org/>. ++ + melezhik (Alexey) sent me a link where he published a chef recipe to + work with CPAN.pm: http://community.opscode.com/cookbooks/cpan. + diff --git a/meta/recipes-devtools/perl/perl/fixes/document_makemaker_ccflags.diff b/meta/recipes-devtools/perl/perl/fixes/document_makemaker_ccflags.diff new file mode 100644 index 0000000000..f1ed3b9fb8 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/document_makemaker_ccflags.diff @@ -0,0 +1,32 @@ +From 14385d93ff7d29b73e74b3a5f3ccb95b54d00ba6 Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +Date: Mon, 30 May 2011 22:54:24 +0300 +Subject: [PATCH] Document that CCFLAGS should include $Config{ccflags} + +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=68613 +Bug-Debian: http://bugs.debian.org/628522 + +Compiling XS extensions without $Config{ccflags} can break the +binary interface on some platforms. + +Patch-Name: fixes/document_makemaker_ccflags.diff + +--- + cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm +index d579256..0b154e2 100644 +--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm ++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm +@@ -1839,6 +1839,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs. + String that will be included in the compiler call command line between + the arguments INC and OPTIMIZE. + ++The default value is taken from $Config{ccflags}. When overriding ++CCFLAGS, make sure to include the $Config{ccflags} settings to avoid ++binary incompatibilities. ++ + =item CONFIG + + Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from diff --git a/meta/recipes-devtools/perl/perl/fixes/encode-alias-regexp.diff b/meta/recipes-devtools/perl/perl/fixes/encode-alias-regexp.diff new file mode 100644 index 0000000000..be8d97877e --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/encode-alias-regexp.diff @@ -0,0 +1,27 @@ +From cd21384376d32eaf01141cea24b09a35aadc13dc Mon Sep 17 00:00:00 2001 +From: Dan Kogai <dankogai+github@gmail.com> +Date: Tue, 9 Jan 2018 14:39:26 +0900 +Subject: [PATCH] fix https://github.com/dankogai/p5-encode/issues/127 + +Bug-Debian: https://bugs.debian.org/880085 +Bug: https://github.com/dankogai/p5-encode/issues/127 +Origin: backport, https://github.com/dankogai/p5-encode/commit/7609648146d4742b9e92861a0497892eff891f20 +Patch-Name: fixes/encode-alias-regexp.diff + +--- + cpan/Encode/lib/Encode/Alias.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cpan/Encode/lib/Encode/Alias.pm b/cpan/Encode/lib/Encode/Alias.pm +index 0a25256..5b184e0 100644 +--- a/cpan/Encode/lib/Encode/Alias.pm ++++ b/cpan/Encode/lib/Encode/Alias.pm +@@ -270,7 +270,7 @@ sub init_aliases { + define_alias( qr/\bUTF-8$/i => '"utf-8-strict"' ); + + # At last, Map white space and _ to '-' +- define_alias( qr/^(\S+)[\s_]+(.*)$/i => '"$1-$2"' ); ++ define_alias( qr/^([^\s_]+)[\s_]+([^\s_]*)$/i => '"$1-$2"' ); + } + + 1; diff --git a/meta/recipes-devtools/perl/perl/fixes/extutils_file_path_compat.diff b/meta/recipes-devtools/perl/perl/fixes/extutils_file_path_compat.diff new file mode 100644 index 0000000000..f1ef61de18 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/extutils_file_path_compat.diff @@ -0,0 +1,53 @@ +From 4636b3bfd2ccdacc60da0e7a858c6c5a4e0cb659 Mon Sep 17 00:00:00 2001 +From: James E Keenan <jkeenan@cpan.org> +Date: Thu, 11 May 2017 04:23:40 -0400 +Subject: [PATCH] Correct the order of tests of chmod(). (#294) + +Per code review by haarg, the order of tests was wrong in the first place. +Hence, correctly re-ordering them is a better repair than changing one test's +description. + +For: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/294 + +[Debian note: this is a prerequisite for the CVE-2017-6512 fix in +File-Path] + +Bug: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/294 +Patch-Name: fixes/extutils_file_path_compat.diff + +--- + cpan/ExtUtils-MakeMaker/t/eu_command.t | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/cpan/ExtUtils-MakeMaker/t/eu_command.t b/cpan/ExtUtils-MakeMaker/t/eu_command.t +index 269aa5c..32a6f59 100644 +--- a/cpan/ExtUtils-MakeMaker/t/eu_command.t ++++ b/cpan/ExtUtils-MakeMaker/t/eu_command.t +@@ -151,20 +151,21 @@ BEGIN { + is( ((stat('testdir'))[2] & 07777) & 0700, + 0100, 'change a dir to execute-only' ); + +- # change a dir to read-only +- @ARGV = ( '0400', 'testdir' ); ++ # change a dir to write-only ++ @ARGV = ( '0200', 'testdir' ); + ExtUtils::Command::chmod(); + + is( ((stat('testdir'))[2] & 07777) & 0700, +- 0400, 'change a dir to read-only' ); ++ 0200, 'change a dir to write-only' ); + +- # change a dir to write-only +- @ARGV = ( '0200', 'testdir' ); ++ # change a dir to read-only ++ @ARGV = ( '0400', 'testdir' ); + ExtUtils::Command::chmod(); + + is( ((stat('testdir'))[2] & 07777) & 0700, +- 0200, 'change a dir to write-only' ); ++ 0400, 'change a dir to read-only' ); + ++ # remove the dir we've been playing with + @ARGV = ('testdir'); + rm_rf; + ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' ); diff --git a/meta/recipes-devtools/perl/perl/fixes/extutils_makemaker_reproducible.diff b/meta/recipes-devtools/perl/perl/fixes/extutils_makemaker_reproducible.diff new file mode 100644 index 0000000000..9474a2ab55 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/extutils_makemaker_reproducible.diff @@ -0,0 +1,41 @@ +From ee45bd25752f7034faf80d968ddf5adfb2694ed8 Mon Sep 17 00:00:00 2001 +From: Chris Lamb <lamby@debian.org> +Date: Sun, 28 Aug 2016 17:22:10 +0100 +Subject: [PATCH] Make perllocal.pod files reproducible + +Bug-Debian: https://bugs.debian.org/834190 +Bug-Debian: https://bugs.debian.org/835815 +Patch-Name: fixes/extutils_makemaker_reproducible.diff + +--- + cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm | 3 ++- + cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm +index 69779b2..bf53ad5 100644 +--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm ++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm +@@ -219,7 +219,8 @@ sub perllocal_install { + : @ARGV; + + my $pod; +- $pod = sprintf <<'POD', scalar(localtime), $type, $name, $name; ++ my $time = gmtime($ENV{SOURCE_DATE_EPOCH} || time); ++ $pod = sprintf <<'POD', $time, $type, $name, $name; + =head2 %s: C<%s> L<%s|%s> + + =over 4 +diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +index 8ea92e5..0344194 100644 +--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm ++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +@@ -3869,7 +3869,7 @@ Obsolete, deprecated method. Not used since Version 5.21. + sub writedoc { + # --- perllocal.pod section --- + my($self,$what,$name,@attribs)=@_; +- my $time = localtime; ++ my $time = gmtime($ENV{SOURCE_DATE_EPOCH} || time); + print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n"; + print join "\n\n=item *\n\n", map("C<$_>",@attribs); + print "\n\n=back\n\n"; diff --git a/meta/recipes-devtools/perl/perl/fixes/file_path_chmod_race.diff b/meta/recipes-devtools/perl/perl/fixes/file_path_chmod_race.diff new file mode 100644 index 0000000000..9902e0f3e1 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/file_path_chmod_race.diff @@ -0,0 +1,163 @@ +From b8507de17cceea6fe6ab7d67807600814d2eb971 Mon Sep 17 00:00:00 2001 +From: John Lightsey <john@nixnuts.net> +Date: Tue, 2 May 2017 12:03:52 -0500 +Subject: [PATCH] Prevent directory chmod race attack. + +CVE-2017-6512 is a race condition attack where the chmod() of directories +that cannot be entered is misused to change the permissions on other +files or directories on the system. This has been corrected by limiting +the directory-permission loosening logic to systems where fchmod() is +supported. + +[Backported (whitespace adjustments) to File-Path 2.12 / perl 5.24 by +Dominic Hargreaves for Debian.] + +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=121951 +Bug-Debian: https://bugs.debian.org/863870 +Patch-Name: fixes/file_path_chmod_race.diff + +--- + cpan/File-Path/lib/File/Path.pm | 39 +++++++++++++++++++++++++-------------- + cpan/File-Path/t/Path.t | 40 ++++++++++++++++++++++++++-------------- + 2 files changed, 51 insertions(+), 28 deletions(-) + +diff --git a/cpan/File-Path/lib/File/Path.pm b/cpan/File-Path/lib/File/Path.pm +index 034da1e..a824cc8 100644 +--- a/cpan/File-Path/lib/File/Path.pm ++++ b/cpan/File-Path/lib/File/Path.pm +@@ -354,21 +354,32 @@ sub _rmtree { + + # see if we can escalate privileges to get in + # (e.g. funny protection mask such as -w- instead of rwx) +- $perm &= oct '7777'; +- my $nperm = $perm | oct '700'; +- if ( +- !( +- $arg->{safe} +- or $nperm == $perm +- or chmod( $nperm, $root ) +- ) +- ) +- { +- _error( $arg, +- "cannot make child directory read-write-exec", $canon ); +- next ROOT_DIR; ++ # This uses fchmod to avoid traversing outside of the proper ++ # location (CVE-2017-6512) ++ my $root_fh; ++ if (open($root_fh, '<', $root)) { ++ my ($fh_dev, $fh_inode) = (stat $root_fh )[0,1]; ++ $perm &= oct '7777'; ++ my $nperm = $perm | oct '700'; ++ local $@; ++ if ( ++ !( ++ $arg->{safe} ++ or $nperm == $perm ++ or !-d _ ++ or $fh_dev ne $ldev ++ or $fh_inode ne $lino ++ or eval { chmod( $nperm, $root_fh ) } ++ ) ++ ) ++ { ++ _error( $arg, ++ "cannot make child directory read-write-exec", $canon ); ++ next ROOT_DIR; ++ } ++ close $root_fh; + } +- elsif ( !chdir($root) ) { ++ if ( !chdir($root) ) { + _error( $arg, "cannot chdir to child", $canon ); + next ROOT_DIR; + } +diff --git a/cpan/File-Path/t/Path.t b/cpan/File-Path/t/Path.t +index 5644f57..fffc49c 100644 +--- a/cpan/File-Path/t/Path.t ++++ b/cpan/File-Path/t/Path.t +@@ -3,7 +3,7 @@ + + use strict; + +-use Test::More tests => 127; ++use Test::More tests => 126; + use Config; + use Fcntl ':mode'; + use lib 't/'; +@@ -17,6 +17,13 @@ BEGIN { + + my $Is_VMS = $^O eq 'VMS'; + ++my $fchmod_supported = 0; ++if (open my $fh, curdir()) { ++ my ($perm) = (stat($fh))[2]; ++ $perm &= 07777; ++ eval { $fchmod_supported = chmod( $perm, $fh); }; ++} ++ + # first check for stupid permissions second for full, so we clean up + # behind ourselves + for my $perm (0111,0777) { +@@ -298,16 +305,19 @@ is($created[0], $dir, "created directory (old style 3 mode undef) cross-check"); + + is(rmtree($dir, 0, undef), 1, "removed directory 3 verbose undef"); + +-$dir = catdir($tmp_base,'G'); +-$dir = VMS::Filespec::unixify($dir) if $Is_VMS; ++SKIP: { ++ skip "fchmod of directories not supported on this platform", 3 unless $fchmod_supported; ++ $dir = catdir($tmp_base,'G'); ++ $dir = VMS::Filespec::unixify($dir) if $Is_VMS; + +-@created = mkpath($dir, undef, 0200); ++ @created = mkpath($dir, undef, 0400); + +-is(scalar(@created), 1, "created write-only dir"); ++ is(scalar(@created), 1, "created read-only dir"); + +-is($created[0], $dir, "created write-only directory cross-check"); ++ is($created[0], $dir, "created read-only directory cross-check"); + +-is(rmtree($dir), 1, "removed write-only dir"); ++ is(rmtree($dir), 1, "removed read-only dir"); ++} + + # borderline new-style heuristics + if (chdir $tmp_base) { +@@ -449,26 +459,28 @@ SKIP: { + } + + SKIP : { +- my $skip_count = 19; ++ my $skip_count = 18; + # this test will fail on Windows, as per: + # http://perldoc.perl.org/perlport.html#chmod + + skip "Windows chmod test skipped", $skip_count + if $^O eq 'MSWin32'; ++ skip "fchmod() on directories is not supported on this platform", $skip_count ++ unless $fchmod_supported; + my $mode; + my $octal_mode; + my @inputs = ( +- 0777, 0700, 0070, 0007, +- 0333, 0300, 0030, 0003, +- 0111, 0100, 0010, 0001, +- 0731, 0713, 0317, 0371, 0173, 0137, +- 00 ); ++ 0777, 0700, 0470, 0407, ++ 0433, 0400, 0430, 0403, ++ 0111, 0100, 0110, 0101, ++ 0731, 0713, 0317, 0371, ++ 0173, 0137); + my $input; + my $octal_input; +- $dir = catdir($tmp_base, 'chmod_test'); + + foreach (@inputs) { + $input = $_; ++ $dir = catdir($tmp_base, sprintf("chmod_test%04o", $input)); + # We can skip from here because 0 is last in the list. + skip "Mode of 0 means assume user defaults on VMS", 1 + if ($input == 0 && $Is_VMS); diff --git a/meta/recipes-devtools/perl/perl/fixes/file_path_hurd_errno.diff b/meta/recipes-devtools/perl/perl/fixes/file_path_hurd_errno.diff new file mode 100644 index 0000000000..ca5c51ab87 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/file_path_hurd_errno.diff @@ -0,0 +1,32 @@ +From e504c7f1978469462558090a1c5cc5c7e9e15ae6 Mon Sep 17 00:00:00 2001 +From: Pino Toscano <pino@debian.org> +Date: Thu, 8 Sep 2016 10:26:59 +0100 +Subject: [PATCH] File-Path: Fix test failure in Hurd due to hard-coded ENOENT + +Patch-Name: fixes/file_path_hurd_errno.diff + +--- + cpan/File-Path/t/Path.t | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/cpan/File-Path/t/Path.t b/cpan/File-Path/t/Path.t +index fffc49c..956ca09 100644 +--- a/cpan/File-Path/t/Path.t ++++ b/cpan/File-Path/t/Path.t +@@ -8,6 +8,7 @@ use Config; + use Fcntl ':mode'; + use lib 't/'; + use FilePathTest; ++use Errno qw(:POSIX); + + BEGIN { + use_ok('Cwd'); +@@ -668,7 +669,7 @@ is( + { + my ($x, $message, $object, $expect, $rv, $arg, $error); + my ($k, $v, $second_error, $third_error); +- local $! = 2; ++ local $! = ENOENT; + $x = $!; + + $message = 'message in a bottle'; diff --git a/meta/recipes-devtools/perl/perl/fixes/getopt-long-2.diff b/meta/recipes-devtools/perl/perl/fixes/getopt-long-2.diff new file mode 100644 index 0000000000..d4fa69cc93 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/getopt-long-2.diff @@ -0,0 +1,58 @@ +From 04ab4420bf9e7690c612b555ae8ad396b2a3a855 Mon Sep 17 00:00:00 2001 +From: Johan Vromans <jvromans@squirrel.nl> +Date: Wed, 22 Feb 2017 12:10:34 +0100 +Subject: [PATCH] Withdraw part of commit + 5d9947fb445327c7299d8beb009d609bc70066c0, which tries to implement more GNU + getopt_long campatibility. GNU getopt_long() does not accept the (optional) + argument to be passed to the option without = sign. However, we do, since not + doing so breaks existing scripts. + +Origin: backport, https://github.com/sciurius/perl-Getopt-Long/commit/258074ddb2f8960eb1c74a5b20d6ea7263c3bb13 +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=120300 +Patch-Name: fixes/getopt-long-2.diff + +--- + cpan/Getopt-Long/lib/Getopt/Long.pm | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm +index 5e1834f..9d38673 100644 +--- a/cpan/Getopt-Long/lib/Getopt/Long.pm ++++ b/cpan/Getopt-Long/lib/Getopt/Long.pm +@@ -1110,9 +1110,17 @@ sub FindOption ($$$$$) { + + # Check if there is an option argument available. + if ( $gnu_compat ) { +- my $optargtype = 0; # 0 = none, 1 = empty, 2 = nonempty +- $optargtype = ( !defined($optarg) ? 0 : ( (length($optarg) == 0) ? 1 : 2 ) ); +- return (1, $opt, $ctl, defined($ctl->[CTL_DEFAULT]) ? $ctl->[CTL_DEFAULT] : undef) ++ my $optargtype = 0; # none, 1 = empty, 2 = nonempty, 3 = aux ++ if ( defined($optarg) ) { ++ $optargtype = (length($optarg) == 0) ? 1 : 2; ++ } ++ elsif ( defined $rest || @$argv > 0 ) { ++ # GNU getopt_long() does not accept the (optional) ++ # argument to be passed to the option without = sign. ++ # We do, since not doing so breaks existing scripts. ++ $optargtype = 3; ++ } ++ return (1, $opt, $ctl, $ctl->[CTL_DEFAULT]) + if (($optargtype == 0) && !$mand); + return (1, $opt, $ctl, $type eq 's' ? '' : 0) + if $optargtype == 1; # --foo= -> return nothing +@@ -2322,11 +2330,14 @@ do. Without C<gnu_compat>, C<--opt=> gives an error. With C<gnu_compat>, + C<--opt=> will give option C<opt> and empty value. + This is the way GNU getopt_long() does it. + ++Note that C<--opt value> is still accepted, even though GNU ++getopt_long() doesn't. ++ + =item gnu_getopt + + This is a short way of setting C<gnu_compat> C<bundling> C<permute> + C<no_getopt_compat>. With C<gnu_getopt>, command line handling should be +-fully compatible with GNU getopt_long(). ++reasonably compatible with GNU getopt_long(). + + =item require_order + diff --git a/meta/recipes-devtools/perl/perl/fixes/getopt-long-3.diff b/meta/recipes-devtools/perl/perl/fixes/getopt-long-3.diff new file mode 100644 index 0000000000..8d14362e88 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/getopt-long-3.diff @@ -0,0 +1,41 @@ +From f2a5c8b66c83fe4719dee9c50edeb2d6f8925c19 Mon Sep 17 00:00:00 2001 +From: Andrew Gregory <andrew.gregory.8@gmail.com> +Date: Sun, 21 May 2017 21:12:21 -0400 +Subject: [PATCH] provide a default value for optional arguments + +When using gnu_compat, FindOption would return undef as the value for +the options with optional arguments if none was provided. Subsequent +processing in GetOptionsFromArray is skipped entirely for undef values, +causing the option to be silently discarded. The following code snippet +demonstrates the issue: + + use Getopt::Long qw(GetOptionsFromArray :config gnu_compat); + GetOptionsFromArray( ['--foo'], 'foo:s' => sub { print("success") } ); + +Origin: backport, https://github.com/sciurius/perl-Getopt-Long/commit/2d16f355e25537aa742eb2833a7d52a63051429b +Patch-Name: fixes/getopt-long-3.diff + +--- + cpan/Getopt-Long/lib/Getopt/Long.pm | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm +index 9d38673..e7e033b 100644 +--- a/cpan/Getopt-Long/lib/Getopt/Long.pm ++++ b/cpan/Getopt-Long/lib/Getopt/Long.pm +@@ -1120,8 +1120,13 @@ sub FindOption ($$$$$) { + # We do, since not doing so breaks existing scripts. + $optargtype = 3; + } +- return (1, $opt, $ctl, $ctl->[CTL_DEFAULT]) +- if (($optargtype == 0) && !$mand); ++ if(($optargtype == 0) && !$mand) { ++ my $val ++ = defined($ctl->[CTL_DEFAULT]) ? $ctl->[CTL_DEFAULT] ++ : $type eq 's' ? '' ++ : 0; ++ return (1, $opt, $ctl, $val); ++ } + return (1, $opt, $ctl, $type eq 's' ? '' : 0) + if $optargtype == 1; # --foo= -> return nothing + } diff --git a/meta/recipes-devtools/perl/perl/fixes/getopt-long-4.diff b/meta/recipes-devtools/perl/perl/fixes/getopt-long-4.diff new file mode 100644 index 0000000000..a09507c4c6 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/getopt-long-4.diff @@ -0,0 +1,31 @@ +From d315170f16aaace8bebf44e652d83c594621519e Mon Sep 17 00:00:00 2001 +From: Johan Vromans <jvromans@squirrel.nl> +Date: Tue, 13 Jun 2017 13:26:00 +0200 +Subject: [PATCH] Fix issue #122068. + +Origin: backport, https://github.com/sciurius/perl-Getopt-Long/commit/2d16f355e25537aa742eb2833a7d52a63051429b +Bug: https://rt.cpan.org/Ticket/Display.html?id=122068 +Bug-Debian: https://bugs.debian.org/864544 +Patch-Name: fixes/getopt-long-4.diff + +--- + cpan/Getopt-Long/lib/Getopt/Long.pm | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm +index e7e033b..4cdfe92 100644 +--- a/cpan/Getopt-Long/lib/Getopt/Long.pm ++++ b/cpan/Getopt-Long/lib/Getopt/Long.pm +@@ -1121,6 +1121,12 @@ sub FindOption ($$$$$) { + $optargtype = 3; + } + if(($optargtype == 0) && !$mand) { ++ if ( $type eq 'I' ) { ++ # Fake incremental type. ++ my @c = @$ctl; ++ $c[CTL_TYPE] = '+'; ++ return (1, $opt, \@c, 1); ++ } + my $val + = defined($ctl->[CTL_DEFAULT]) ? $ctl->[CTL_DEFAULT] + : $type eq 's' ? '' diff --git a/meta/recipes-devtools/perl/perl/fixes/json-pp-example.diff b/meta/recipes-devtools/perl/perl/fixes/json-pp-example.diff new file mode 100644 index 0000000000..e3f3b3b9f3 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/json-pp-example.diff @@ -0,0 +1,27 @@ +From e309e7edaad1621e517967e67e81454a2035f034 Mon Sep 17 00:00:00 2001 +From: Kenichi Ishigaki <ishigaki@cpan.org> +Date: Sat, 27 Aug 2016 22:59:58 +0900 +Subject: [PATCH] fix RT-92793: bug in SYNOPSIS + +Bug-Debian: https://bugs.debian.org/871837 +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=92793 +Origin: backport, https://github.com/makamaka/JSON-PP/commit/e4da34595ae4cd36e58940f06640f0bf2c40976b +Patch-Name: fixes/json-pp-example.diff + +--- + cpan/JSON-PP/lib/JSON/PP.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm +index 9337ce9..ff0e88a 100644 +--- a/cpan/JSON-PP/lib/JSON/PP.pm ++++ b/cpan/JSON-PP/lib/JSON/PP.pm +@@ -1613,7 +1613,7 @@ JSON::PP - JSON::XS compatible pure-Perl module. + + # OO-interface + +- $coder = JSON::PP->new->ascii->pretty->allow_nonref; ++ $json = JSON::PP->new->ascii->pretty->allow_nonref; + + $json_text = $json->encode( $perl_scalar ); + $perl_scalar = $json->decode( $json_text ); diff --git a/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_angle_units.diff b/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_angle_units.diff new file mode 100644 index 0000000000..d21b021a49 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_angle_units.diff @@ -0,0 +1,29 @@ +From c81abec8af46d3afb3f91700c4733d18d80cff5d Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Sat, 30 Apr 2016 22:56:56 +0100 +Subject: [PATCH] Math::Trig: document angle units + +Bug: https://rt.cpan.org/Ticket/Display.html?id=114106 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=731505 +Patch-Name: fixes/math_complex_doc_angle_units.diff + +--- + cpan/Math-Complex/lib/Math/Trig.pm | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/cpan/Math-Complex/lib/Math/Trig.pm b/cpan/Math-Complex/lib/Math/Trig.pm +index 1d9612a..728da3e 100644 +--- a/cpan/Math-Complex/lib/Math/Trig.pm ++++ b/cpan/Math-Complex/lib/Math/Trig.pm +@@ -263,6 +263,11 @@ core Perl which defines only the C<sin()> and C<cos()>. The constant + B<pi> is also defined as are a few convenience functions for angle + conversions, and I<great circle formulas> for spherical movement. + ++=head1 ANGLES ++ ++All angles are defined in radians, except where otherwise specified ++(for example in the deg/rad conversion functions). ++ + =head1 TRIGONOMETRIC FUNCTIONS + + The tangent diff --git a/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_great_circle.diff b/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_great_circle.diff new file mode 100644 index 0000000000..d4b98d9c04 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_great_circle.diff @@ -0,0 +1,26 @@ +From ffebd2c39731282d0194acf9882cc9f0b315860c Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Sat, 30 Apr 2016 22:50:52 +0100 +Subject: [PATCH] Math::Trig: clarify definition of great_circle_midpoint + +Bug: https://rt.cpan.org/Ticket/Display.html?id=114104 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697567 +Patch-Name: fixes/math_complex_doc_great_circle.diff + +--- + cpan/Math-Complex/lib/Math/Trig.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cpan/Math-Complex/lib/Math/Trig.pm b/cpan/Math-Complex/lib/Math/Trig.pm +index 728da3e..89dcd09 100644 +--- a/cpan/Math-Complex/lib/Math/Trig.pm ++++ b/cpan/Math-Complex/lib/Math/Trig.pm +@@ -613,7 +613,7 @@ or the midpoint if you know the end points: + ($thetam, $phim) = + great_circle_midpoint($theta0, $phi0, $theta1, $phi1); + +-The great_circle_midpoint() is just a special case of ++The great_circle_midpoint() is just a special case (with $way = 0.5) of + + =head2 great_circle_waypoint + diff --git a/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_see_also.diff b/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_see_also.diff new file mode 100644 index 0000000000..01e58de149 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/math_complex_doc_see_also.diff @@ -0,0 +1,26 @@ +From 93fe0546af1b77897ec127db729a71e983dd79a0 Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Sat, 30 Apr 2016 22:53:44 +0100 +Subject: [PATCH] Math::Trig: add missing SEE ALSO + +Bug: https://rt.cpan.org/Ticket/Display.html?id=114105 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697568 +Patch-Name: fixes/math_complex_doc_see_also.diff + +--- + cpan/Math-Complex/lib/Math/Trig.pm | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cpan/Math-Complex/lib/Math/Trig.pm b/cpan/Math-Complex/lib/Math/Trig.pm +index 89dcd09..bc7ac78 100644 +--- a/cpan/Math-Complex/lib/Math/Trig.pm ++++ b/cpan/Math-Complex/lib/Math/Trig.pm +@@ -748,6 +748,8 @@ an answer instead of giving a fatal runtime error. + + Do not attempt navigation using these formulas. + ++=head1 SEE ALSO ++ + L<Math::Complex> + + =head1 AUTHORS diff --git a/meta/recipes-devtools/perl/perl/fixes/memoize-pod.diff b/meta/recipes-devtools/perl/perl/fixes/memoize-pod.diff new file mode 100644 index 0000000000..7f0ffe6542 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/memoize-pod.diff @@ -0,0 +1,35 @@ +From 638e0106772943bbb4faf89cb720fbefe746003a Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +Date: Sat, 6 Feb 2016 20:15:19 +0200 +Subject: [PATCH] Fix POD errors in Memoize + +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=89441 +Author: Dominic Hargreaves <dom@cpan.org> +Patch-Name: fixes/memoize-pod.diff + +--- + cpan/Memoize/Memoize.pm | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cpan/Memoize/Memoize.pm b/cpan/Memoize/Memoize.pm +index f4e6522..2f28b36 100644 +--- a/cpan/Memoize/Memoize.pm ++++ b/cpan/Memoize/Memoize.pm +@@ -752,6 +752,8 @@ cache that was populated by the first call. C<complicated> ends up + being called only once, and both subsequent calls return C<3> from the + cache, regardless of the calling context. + ++=back ++ + =head3 List values in scalar context + + Consider this function: +@@ -801,8 +803,6 @@ This normalizer function will store scalar context return values in + the disk file under keys that begin with C<S:>, and list context + return values under keys that begin with C<L:>. + +-=back +- + =head1 OTHER FACILITIES + + =head2 C<unmemoize> diff --git a/meta/recipes-devtools/perl/perl/fixes/memoize_storable_nstore.diff b/meta/recipes-devtools/perl/perl/fixes/memoize_storable_nstore.diff new file mode 100644 index 0000000000..61005343f6 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/memoize_storable_nstore.diff @@ -0,0 +1,110 @@ +From 1e0e57ed2add974f85fda05bf2ef2072e85e3fa5 Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder <jrnieder@gmail.com> +Date: Fri, 27 Jul 2012 10:35:07 -0500 +Subject: Memoize::Storable: respect 'nstore' option not respected +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Memoize(3perl) says: + + tie my %cache => 'Memoize::Storable', $filename, 'nstore'; + memoize 'function', SCALAR_CACHE => [HASH => \%cache]; + + Include the ‘nstore’ option to have the "Storable" database + written in ‘network order’. (See Storable for more details + about this.) + +In fact the "nstore" option does no such thing. Option parsing looks +like this: + + @options{@_} = (); + +$self->{OPTIONS}{'nstore'} is accordingly set to undef. Later +Memoize::Storable checks if the option is true, and since undef is +not true, the "else" branch is always taken. + + if ($self->{OPTIONS}{'nstore'}) { + Storable::nstore($self->{H}, $self->{FILENAME}); + } else { + Storable::store($self->{H}, $self->{FILENAME}); + } + +Correcting the condition to (exists $self->{OPTIONS}{'nstore'}) fixes +it. + +Noticed because git-svn, which uses the 'nstore' option for its +on-disk caches, was producing + + Byte order is not compatible at ../../lib/Storable.pm + +when run using a perl with a different integer size (and hence +byteorder). + +Reported by Tim Retout (RT#77790) + +Bug-Debian: http://bugs.debian.org/587650 +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=77790 +Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=77790 +Patch-Name: fixes/memoize_storable_nstore.diff +--- + cpan/Memoize/Memoize/Storable.pm | 2 +- + cpan/Memoize/t/tie_storable.t | 24 ++++++++++++++++++++---- + 2 files changed, 21 insertions(+), 5 deletions(-) + +diff --git a/cpan/Memoize/Memoize/Storable.pm b/cpan/Memoize/Memoize/Storable.pm +index 1314797297..87876f227e 100644 +--- a/cpan/Memoize/Memoize/Storable.pm ++++ b/cpan/Memoize/Memoize/Storable.pm +@@ -55,7 +55,7 @@ sub DESTROY { + require Carp if $Verbose; + my $self= shift; + print STDERR "Memoize::Storable::DESTROY(@_)\n" if $Verbose; +- if ($self->{OPTIONS}{'nstore'}) { ++ if (exists $self->{OPTIONS}{'nstore'}) { + Storable::nstore($self->{H}, $self->{FILENAME}); + } else { + Storable::store($self->{H}, $self->{FILENAME}); +diff --git a/cpan/Memoize/t/tie_storable.t b/cpan/Memoize/t/tie_storable.t +index de3b8dc26b..a62423850e 100644 +--- a/cpan/Memoize/t/tie_storable.t ++++ b/cpan/Memoize/t/tie_storable.t +@@ -31,18 +31,34 @@ if ($@) { + exit 0; + } + +-print "1..4\n"; ++print "1..9\n"; + + $file = "storable$$"; + 1 while unlink $file; + tryout('Memoize::Storable', $file, 1); # Test 1..4 + 1 while unlink $file; ++tryout('Memoize::Storable', $file, 5, 'nstore'); # Test 5..8 ++assert_netorder($file, 9); # Test 9 ++1 while unlink $file; ++ ++ ++sub assert_netorder { ++ my ($file, $testno) = @_; ++ ++ my $netorder = Storable::file_magic($file)->{'netorder'}; ++ print ($netorder ? "ok $testno\n" : "not ok $testno\n"); ++} + + sub tryout { +- my ($tiepack, $file, $testno) = @_; ++ my ($tiepack, $file, $testno, $option) = @_; + +- tie my %cache => $tiepack, $file +- or die $!; ++ if (defined $option) { ++ tie my %cache => $tiepack, $file, $option ++ or die $!; ++ } else { ++ tie my %cache => $tiepack, $file ++ or die $!; ++ } + + memoize 'c5', + SCALAR_CACHE => [HASH => \%cache], diff --git a/meta/recipes-devtools/perl/perl/fixes/packaging_test_skips.diff b/meta/recipes-devtools/perl/perl/fixes/packaging_test_skips.diff new file mode 100644 index 0000000000..cf03dcf989 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/packaging_test_skips.diff @@ -0,0 +1,121 @@ +From 41946a7ff425786d1ba38cbe0337e35bafb33a54 Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Sat, 14 Oct 2017 16:27:53 +0200 +Subject: Skip various tests if PERL_BUILD_PACKAGING is set + +These are tests which tend not to be useful for downstream packagers + +t/porting/customized.t change originally from Todd Rinaldo + +Patch-Name: fixes/packaging_test_skips.diff +--- + INSTALL | 3 ++- + MANIFEST | 1 + + PACKAGING | 30 ++++++++++++++++++++++++++++++ + regen/lib_cleanup.pl | 5 +++++ + t/porting/customized.t | 1 + + t/test.pl | 3 +++ + 6 files changed, 42 insertions(+), 1 deletion(-) + create mode 100644 PACKAGING + +diff --git a/INSTALL b/INSTALL +index 0544b420ca..6af71dcdad 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -2724,4 +2724,5 @@ This document is part of the Perl package and may be distributed under + the same terms as perl itself, with the following additional request: + If you are distributing a modified version of perl (perhaps as part of + a larger package) please B<do> modify these installation instructions +-and the contact information to match your distribution. ++and the contact information to match your distribution. Additional ++information for packagers is in F<PACKAGING>. +diff --git a/MANIFEST b/MANIFEST +index e102bf9277..37f901f4d8 100644 +--- a/MANIFEST ++++ b/MANIFEST +@@ -4864,6 +4864,7 @@ os2/perlrexx.c Support perl interpreter embedded in REXX + os2/perlrexx.cmd Test perl interpreter embedded in REXX + overload.h generated overload enum (public) + overload.inc generated overload name table (implementation) ++PACKAGING notes and best practice for packaging perl 5 + packsizetables.inc The generated packprops array used in pp_pack.c + pad.c Scratchpad functions + pad.h Scratchpad headers +diff --git a/PACKAGING b/PACKAGING +new file mode 100644 +index 0000000000..6369f0b979 +--- /dev/null ++++ b/PACKAGING +@@ -0,0 +1,30 @@ ++If you read this file _as_is_, just ignore the funny characters you ++see. It is written in the POD format (see pod/perlpod.pod) which is ++specifically designed to be readable as is. ++ ++=head1 NAME ++ ++PACKAGING - notes and best practice for packaging perl 5 ++ ++=head1 SYNOPSIS ++ ++This document is aimed at anyone who is producing their own version of ++perl for distribution to other users. It is intended as a collection ++of useful tips, advice and best practice, rather than being a complete ++packaging manual. The starting point for installing perl remains ++F<INSTALL>. ++ ++=head1 Customizing test running ++ ++A small number of porting tests (those in t/porting) tests are not well ++suited to typical distribution packaging scenarios. For example, they ++assume they are working in a git clone of the upstream Perl repository, ++or enforce rules which are not relevant to downstream packagers. ++These can be skipped by setting the environment variable ++PERL_BUILD_PACKAGING. A complete list of tests which this applied to ++can be found by searching the codebase for this string. ++ ++An alternative strategy would be to skip all porting tests, but many of ++them are useful if additional patches might be applied. ++ ++=cut +diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl +index 5e40b405a4..6caf74a563 100644 +--- a/regen/lib_cleanup.pl ++++ b/regen/lib_cleanup.pl +@@ -164,6 +164,11 @@ if ($TAP && !-d '.git' && !-f 'lib/.gitignore') { + exit 0; + } + ++if ($ENV{'PERL_BUILD_PACKAGING'}) { ++ print "ok # skip explicitly disabled git tests by PERL_BUILD_PACKAGING\n"; ++ exit 0; ++} ++ + $fh = open_new('lib/.gitignore', '>', + { by => $0, + from => 'MANIFEST and parsing files in cpan/ dist/ and ext/'}); +diff --git a/t/porting/customized.t b/t/porting/customized.t +index 3bd6adb33a..fdaa3c4562 100644 +--- a/t/porting/customized.t ++++ b/t/porting/customized.t +@@ -13,6 +13,7 @@ BEGIN { + @INC = qw(lib Porting t); + require 'test.pl'; + skip_all("pre-computed SHA1 won't match under EBCDIC") if $::IS_EBCDIC; ++ skip_all("This distro may have modified some files in cpan/. Skipping validation.") if $ENV{'PERL_BUILD_PACKAGING'}; + } + + use strict; +diff --git a/t/test.pl b/t/test.pl +index d86f6332b3..55ec664565 100644 +--- a/t/test.pl ++++ b/t/test.pl +@@ -212,6 +212,9 @@ sub find_git_or_skip { + } else { + $reason = 'not being run from a git checkout'; + } ++ if ($ENV{'PERL_BUILD_PACKAGING'}) { ++ $reason = 'PERL_BUILD_PACKAGING is set'; ++ } + skip_all($reason) if $_[0] && $_[0] eq 'all'; + skip($reason, @_); + } diff --git a/meta/recipes-devtools/perl/perl/fixes/rename-filexp.U-phase1.diff b/meta/recipes-devtools/perl/perl/fixes/rename-filexp.U-phase1.diff new file mode 100644 index 0000000000..f6cfe32231 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/rename-filexp.U-phase1.diff @@ -0,0 +1,55 @@ +From 59b2f127b56999b3373f6e9855402120ae4b66ab Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +Date: Mon, 16 Oct 2017 01:56:02 +0300 +Subject: regen-configure: rename filexp.U to filexp_path.U, phase 1 + +The renaming placates t/porting/checkcase.t and matches dist upstream. + +It is done in two phases because git-dpm cannot currently handle git +renames properly (i.e. use the --no-renames git-format-patch option +to make the patches compatible with dpkg source format 3.0 (quilt)). + +We therefore copy first and delete afterwards. + +Patch-Name: fixes/rename-filexp.U-phase1.diff +--- + regen-configure/dist/U/filexp_path.U | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + create mode 100644 regen-configure/dist/U/filexp_path.U + +diff --git a/regen-configure/dist/U/filexp_path.U b/regen-configure/dist/U/filexp_path.U +new file mode 100644 +index 0000000000..ea88a34c23 +--- /dev/null ++++ b/regen-configure/dist/U/filexp_path.U +@@ -0,0 +1,30 @@ ++?RCS: $Id: filexp.U 1 2006-08-24 12:32:52Z rmanfredi $ ++?RCS: ++?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ++?RCS: ++?RCS: You may redistribute only under the terms of the Artistic Licence, ++?RCS: as specified in the README file that comes with the distribution. ++?RCS: You may reuse parts of this distribution only within the terms of ++?RCS: that same Artistic Licence; a copy of which may be found at the root ++?RCS: of the source tree for dist 4.0. ++?RCS: ++?RCS: $Log: filexp.U,v $ ++?RCS: Revision 3.0 1993/08/18 12:08:08 ram ++?RCS: Baseline for dist 3.0 netwide release. ++?RCS: ++?MAKE:filexp: privlib ++?MAKE: -pick add $@ %< ++?S:filexp: ++?S: This symbol contains the full pathname of the filexp script, in case we ++?S: are saving the script for posterity. ++?S:. ++: must not allow self reference ++case "$privlib" in ++ /*) ++ filexp=$privlib/filexp ++ ;; ++ *) ++ filexp=`pwd`/filexp ++ ;; ++esac ++ diff --git a/meta/recipes-devtools/perl/perl/fixes/rename-filexp.U-phase2.diff b/meta/recipes-devtools/perl/perl/fixes/rename-filexp.U-phase2.diff new file mode 100644 index 0000000000..158002d069 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/rename-filexp.U-phase2.diff @@ -0,0 +1,55 @@ +From 109a8792ab5ec683bcdc7d392f08d788a72ac08e Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +Date: Mon, 16 Oct 2017 01:56:02 +0300 +Subject: regen-configure: rename filexp.U to filexp_path.U, phase 2 + +The renaming placates t/porting/checkcase.t and matches dist upstream. + +It is done in two phases because git-dpm cannot currently handle git +renames properly (i.e. use the --no-renames git-format-patch option +to make the patches compatible with dpkg source format 3.0 (quilt)). + +We therefore copy first and delete afterwards. + +Patch-Name: fixes/rename-filexp.U-phase2.diff +--- + regen-configure/dist/U/filexp.U | 30 ------------------------------ + 1 file changed, 30 deletions(-) + delete mode 100644 regen-configure/dist/U/filexp.U + +diff --git a/regen-configure/dist/U/filexp.U b/regen-configure/dist/U/filexp.U +deleted file mode 100644 +index ea88a34c23..0000000000 +--- a/regen-configure/dist/U/filexp.U ++++ /dev/null +@@ -1,30 +0,0 @@ +-?RCS: $Id: filexp.U 1 2006-08-24 12:32:52Z rmanfredi $ +-?RCS: +-?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +-?RCS: +-?RCS: You may redistribute only under the terms of the Artistic Licence, +-?RCS: as specified in the README file that comes with the distribution. +-?RCS: You may reuse parts of this distribution only within the terms of +-?RCS: that same Artistic Licence; a copy of which may be found at the root +-?RCS: of the source tree for dist 4.0. +-?RCS: +-?RCS: $Log: filexp.U,v $ +-?RCS: Revision 3.0 1993/08/18 12:08:08 ram +-?RCS: Baseline for dist 3.0 netwide release. +-?RCS: +-?MAKE:filexp: privlib +-?MAKE: -pick add $@ %< +-?S:filexp: +-?S: This symbol contains the full pathname of the filexp script, in case we +-?S: are saving the script for posterity. +-?S:. +-: must not allow self reference +-case "$privlib" in +- /*) +- filexp=$privlib/filexp +- ;; +- *) +- filexp=`pwd`/filexp +- ;; +-esac +- diff --git a/meta/recipes-devtools/perl/perl/fixes/respect_umask.diff b/meta/recipes-devtools/perl/perl/fixes/respect_umask.diff new file mode 100644 index 0000000000..34f700ae5f --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/respect_umask.diff @@ -0,0 +1,153 @@ +From 900e978c41cd85e62187d05a89414d034a1910f2 Mon Sep 17 00:00:00 2001 +From: Brendan O'Dea <bod@debian.org> +Date: Tue, 8 Mar 2005 19:30:38 +1100 +Subject: Respect umask during installation + +This is needed to satisfy Debian policy regarding group-writable +site directories. + +Patch-Name: fixes/respect_umask.diff +--- + cpan/ExtUtils-Install/lib/ExtUtils/Install.pm | 18 +++++++++--------- + cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 18 +++++++++--------- + 2 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm +index 1e8ac4cd12..3e79121f38 100644 +--- a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm ++++ b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm +@@ -451,7 +451,7 @@ sub _can_write_dir { + + =pod + +-=item _mkpath($dir,$show,$mode,$verbose,$dry_run) ++=item _mkpath($dir,$show,$verbose,$dry_run) + + Wrapper around File::Path::mkpath() to handle errors. + +@@ -468,13 +468,13 @@ writable. + =cut + + sub _mkpath { +- my ($dir,$show,$mode,$verbose,$dry_run)=@_; ++ my ($dir,$show,$verbose,$dry_run)=@_; + if ( $verbose && $verbose > 1 && ! -d $dir) { + $show= 1; +- printf "mkpath(%s,%d,%#o)\n", $dir, $show, $mode; ++ printf "mkpath(%s,%d)\n", $dir, $show; + } + if (!$dry_run) { +- if ( ! eval { File::Path::mkpath($dir,$show,$mode); 1 } ) { ++ if ( ! eval { File::Path::mkpath($dir,$show); 1 } ) { + _choke("Can't create '$dir'","$@"); + } + +@@ -783,7 +783,7 @@ sub install { #XXX OS-SPECIFIC + _chdir($cwd); + } + foreach my $targetdir (sort keys %check_dirs) { +- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run ); ++ _mkpath( $targetdir, 0, $verbose, $dry_run ); + } + foreach my $found (@found_files) { + my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime, +@@ -797,7 +797,7 @@ sub install { #XXX OS-SPECIFIC + $targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' ) + unless $dry_run; + } elsif ( ! -d $targetdir ) { +- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run ); ++ _mkpath( $targetdir, 0, $verbose, $dry_run ); + } + print "Installing $targetfile\n"; + +@@ -837,7 +837,7 @@ sub install { #XXX OS-SPECIFIC + + if ($pack{'write'}) { + $dir = install_rooted_dir(dirname($pack{'write'})); +- _mkpath( $dir, 0, 0755, $verbose, $dry_run ); ++ _mkpath( $dir, 0, $verbose, $dry_run ); + print "Writing $pack{'write'}\n" if $verbose; + $packlist->write(install_rooted_file($pack{'write'})) unless $dry_run; + } +@@ -1180,7 +1180,7 @@ environment variable will silence this output. + sub pm_to_blib { + my($fromto,$autodir,$pm_filter) = @_; + +- _mkpath($autodir,0,0755); ++ _mkpath($autodir,0); + while(my($from, $to) = each %$fromto) { + if( -f $to && -s $from == -s $to && -M $to < -M $from ) { + print "Skip $to (unchanged)\n" unless $INSTALL_QUIET; +@@ -1203,7 +1203,7 @@ sub pm_to_blib { + # we wont try hard here. its too likely to mess things up. + forceunlink($to); + } else { +- _mkpath(dirname($to),0,0755); ++ _mkpath(dirname($to),0); + } + if ($need_filtering) { + run_filter($pm_filter, $from, $to); +diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +index 66a24d7838..588c54b9bb 100644 +--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm ++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +@@ -2223,7 +2223,7 @@ doc__install : doc_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + + pure_perl_install :: all +- $(NOECHO) $(MOD_INSTALL) \ ++ $(NOECHO) umask 022; $(MOD_INSTALL) \ + }; + + push @m, +@@ -2243,7 +2243,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \ + + + pure_site_install :: all +- $(NOECHO) $(MOD_INSTALL) \ ++ $(NOECHO) umask 022; $(MOD_INSTALL) \ + }; + push @m, + q{ read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \ +@@ -2261,7 +2261,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \ + "}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{" + + pure_vendor_install :: all +- $(NOECHO) $(MOD_INSTALL) \ ++ $(NOECHO) umask 022; $(MOD_INSTALL) \ + }; + push @m, + q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \ +@@ -2293,8 +2293,8 @@ doc_vendor_install :: all + push @m, q{ + doc_perl_install :: all + $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" +- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" +- -$(NOECHO) $(DOC_INSTALL) \ ++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)" ++ -$(NOECHO) umask 022; $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLPRIVLIB)" \ + LINKTYPE "$(LINKTYPE)" \ +@@ -2304,8 +2304,8 @@ doc_perl_install :: all + + doc_site_install :: all + $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" +- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" +- -$(NOECHO) $(DOC_INSTALL) \ ++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)" ++ -$(NOECHO) umask 022; $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLSITELIB)" \ + LINKTYPE "$(LINKTYPE)" \ +@@ -2315,8 +2315,8 @@ doc_site_install :: all + + doc_vendor_install :: all + $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" +- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" +- -$(NOECHO) $(DOC_INSTALL) \ ++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)" ++ -$(NOECHO) umask 022; $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLVENDORLIB)" \ + LINKTYPE "$(LINKTYPE)" \ diff --git a/meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff b/meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff new file mode 100644 index 0000000000..9774d2cce2 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff @@ -0,0 +1,70 @@ +From 940e2f641870a85d44b8c53e505c8ebccb39f2b1 Mon Sep 17 00:00:00 2001 +From: Chad Granum <exodist7@gmail.com> +Date: Wed, 1 Feb 2017 19:33:57 -0800 +Subject: Reset inside subtest maintains parent + +When TB->reset is called from within a subtest it should maintain the +link to the parent, this link is necessary for unwinding the TB-stack. + +Fixes #757 + +[backported to Debian Perl 5.26 by Niko Tyni <ntyni@debian.org>] + +Origin: backport, https://github.com/Test-More/test-more/commit/68775db7eef1a7e30dc03abf8feabcf3e32301d4 +Bug: https://github.com/Test-More/test-more/issues/757 +Bug-Debian: https://bugs.debian.org/865894 +Patch-Name: fixes/test-builder-reset.diff +--- + cpan/Test-Simple/lib/Test/Builder.pm | 4 +++- + cpan/Test-Simple/t/regression/757-reset_in_subtest.t | 20 ++++++++++++++++++++ + 2 files changed, 23 insertions(+), 1 deletion(-) + create mode 100644 cpan/Test-Simple/t/regression/757-reset_in_subtest.t + +diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm +index 052e2793b9..851a5f6669 100644 +--- a/cpan/Test-Simple/lib/Test/Builder.pm ++++ b/cpan/Test-Simple/lib/Test/Builder.pm +@@ -143,7 +143,8 @@ sub parent { + my $chub = $self->{Hub} || $ctx->hub; + $ctx->release; + +- my $parent = $chub->meta(__PACKAGE__, {})->{parent}; ++ my $meta = $chub->meta(__PACKAGE__, {}); ++ my $parent = $meta->{parent}; + + return undef unless $parent; + +@@ -388,6 +389,7 @@ sub reset { ## no critic (Subroutines::ProhibitBuiltinHomonyms) + Done_Testing => undef, + Skip_All => 0, + Test_Results => [], ++ parent => $meta->{parent}, + ); + + $self->{Exported_To} = undef; +diff --git a/cpan/Test-Simple/t/regression/757-reset_in_subtest.t b/cpan/Test-Simple/t/regression/757-reset_in_subtest.t +new file mode 100644 +index 0000000000..846a34d835 +--- /dev/null ++++ b/cpan/Test-Simple/t/regression/757-reset_in_subtest.t +@@ -0,0 +1,20 @@ ++use strict; ++use warnings; ++ ++use Test::More; ++ ++subtest 'subtest' => sub { ++ Test::Builder->new->reset; ++ ok 1; ++}; ++ ++subtest 'subtest' => sub { ++ Test::Builder->new->reset; ++ subtest 'subtest' => sub { ++ Test::Builder->new->reset; ++ ok 1; ++ }; ++ ok 1; ++}; ++ ++done_testing; diff --git a/meta/recipes-devtools/perl/perl/fixes/test-printf-null.diff b/meta/recipes-devtools/perl/perl/fixes/test-printf-null.diff new file mode 100644 index 0000000000..94547217da --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/test-printf-null.diff @@ -0,0 +1,67 @@ +From 6ed5aa97af1ad9123ccd836fb5d12c94d8b14128 Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +Date: Sat, 24 Mar 2018 16:49:06 +0200 +Subject: Fix pointer to integer cast in null_printf check + +Quoting James Cowgill in https://bugs.debian.org/893601 + +> I recently noticed a build failure in the "mrs" package which embeds the +> perl interpreter. The strange part was that the error looked completely +> generic but only failed on 32-bit for some reason. I traced this to the +> value of the PRINTF_FORMAT_NULL_OK config,h option in perl which is +> defined on 32-bit, but not defined on 64-bit architectures. This is a +> bug because this check detects the behavior of the compiler and should +> be the same on all architectures with the same GCC version. +> +> The underlying bug is that the check for this warning causes GCC to emit +> an unrelated warning on 64-bit arches which tricks the check into not +> defining PRINTF_FORMAT_NULL_OK. +> +> The line which causes the warning is: +> int null_printf (char* pat,...) { return (int)pat; } +> +> GCC complains about the pointer to integer cast of the wrong size but +> only on 64-bits. I've attached a patch to fix this by casting through +> intptr_t first. + +(Also includes a dependency fix from upstream commit 3bddea5a1c1a7721899d5e24f49e9ef21bec9eed) + +Bug: https://github.com/perl5-metaconfig/metaconfig/pull/53 +Bug-Debian: https://bugs.debian.org/893601 +Origin: upstream, https://github.com/perl5-metaconfig/metaconfig/commit/16e38bb83cd44f36aea3c39f90903f640fac3572 +Patch-Name: fixes/test-printf-null.diff +--- + regen-configure/U/modified/d_attribut.U | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/regen-configure/U/modified/d_attribut.U b/regen-configure/U/modified/d_attribut.U +index 8f71d4b08d..86fe17319f 100644 +--- a/regen-configure/U/modified/d_attribut.U ++++ b/regen-configure/U/modified/d_attribut.U +@@ -24,7 +24,8 @@ + d_attribute_nonnull d_attribute_noreturn d_attribute_pure \ + d_attribute_unused d_attribute_warn_unused_result \ + d_printf_format_null: \ +- Myread Oldconfig cat cc ccflags rm Setvar contains i_stdlib run ++ Myread Oldconfig cat cc ccflags rm Setvar contains i_stdlib run \ ++ i_inttypes + ?MAKE: -pick add $@ %< + ?S:d_attribute_format: + ?S: This variable conditionally defines HASATTRIBUTE_FORMAT, which +@@ -159,8 +160,15 @@ $cat >attrib.c <<EOCP + #ifdef I_STDLIB + #include <stdlib.h> + #endif ++#$i_inttypes I_INTTYPES ++#ifdef I_INTTYPES ++#include <inttypes.h> ++#endif ++#ifndef INTPTR_MAX ++#define intptr_t int ++#endif + int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2))); +-int null_printf (char* pat,...) { return (int)pat; } ++int null_printf (char* pat,...) { return (int)(intptr_t)pat; } + int main () { exit(null_printf(NULL)); } + EOCP + if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then diff --git a/meta/recipes-devtools/perl/perl/fixes/time_piece_doc.diff b/meta/recipes-devtools/perl/perl/fixes/time_piece_doc.diff new file mode 100644 index 0000000000..3793e4848a --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/time_piece_doc.diff @@ -0,0 +1,30 @@ +From 2f34b8acecfa25758eb31a541f019a6b2f1a24e0 Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Sat, 30 Apr 2016 23:20:45 +0100 +Subject: Time::Piece: Improve documentation for add_months and add_years + +These methods don't act on the time of the object they are called from, +so the previous documentation was open to misinterpretation. + +Bug: https://github.com/rjbs/Time-Piece/pull/22 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817925 +Patch-Name: fixes/time_piece_doc.diff +--- + cpan/Time-Piece/Piece.pm | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cpan/Time-Piece/Piece.pm b/cpan/Time-Piece/Piece.pm +index 6dbf4d69c4..d3b62ce5fb 100644 +--- a/cpan/Time-Piece/Piece.pm ++++ b/cpan/Time-Piece/Piece.pm +@@ -783,8 +783,8 @@ days, weeks and years in that delta, using the Time::Seconds API. + In addition to adding seconds, there are two APIs for adding months and + years: + +- $t->add_months(6); +- $t->add_years(5); ++ $t = $t->add_months(6); ++ $t = $t->add_years(5); + + The months and years can be negative for subtractions. Note that there + is some "strange" behaviour when adding and subtracting months at the |