Accepting request 668211 from home:bmwiedemann:branches:devel:languages:perl
- Add perl-fix2020.patch to fix timelocal calls in 2020 (boo#1102840) - Add perl-reproducible2.patch to make build reproducible in spite of ASLR OBS-URL: https://build.opensuse.org/request/show/668211 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl?expand=0&rev=178
This commit is contained in:
parent
3f70b4999f
commit
79877b1543
111
perl-fix2020.patch
Normal file
111
perl-fix2020.patch
Normal file
@ -0,0 +1,111 @@
|
||||
submitted upstream
|
||||
|
||||
Author: Bernhard M. Wiedemann <bwiedemann suse de>
|
||||
Date: 2018-03-18
|
||||
Subject: fix calls of timelocal to work after 2019
|
||||
|
||||
because year 70 then starts to mean 2070
|
||||
|
||||
https://bugzilla.opensuse.org/show_bug.cgi?id=1102840 trackerbug: build fails at some time
|
||||
https://rt.perl.org/Ticket/Display.html?id=132896 perl Net::NNTP
|
||||
https://rt.perl.org/Ticket/Display.html?id=132898 perl Net::FTP => https://rt.cpan.org/Public/Bug/Display.html?id=124534
|
||||
https://rt.perl.org/Ticket/Display.html?id=132897 perl doc
|
||||
|
||||
Index: perl-5.26.1/cpan/Time-Local/t/Local.t
|
||||
===================================================================
|
||||
--- perl-5.26.1.orig/cpan/Time-Local/t/Local.t
|
||||
+++ perl-5.26.1/cpan/Time-Local/t/Local.t
|
||||
@@ -85,6 +85,7 @@ my $epoch_is_64
|
||||
|
||||
for ( @time, @neg_time ) {
|
||||
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
|
||||
+ my $year_in = $year;
|
||||
$year -= 1900;
|
||||
$mon--;
|
||||
|
||||
@@ -96,7 +97,6 @@ SKIP: {
|
||||
|
||||
# Test timelocal()
|
||||
{
|
||||
- my $year_in = $year < 70 ? $year + 1900 : $year;
|
||||
my $time = timelocal( $sec, $min, $hour, $mday, $mon, $year_in );
|
||||
|
||||
my ( $s, $m, $h, $D, $M, $Y ) = localtime($time);
|
||||
@@ -111,7 +111,6 @@ SKIP: {
|
||||
|
||||
# Test timegm()
|
||||
{
|
||||
- my $year_in = $year < 70 ? $year + 1900 : $year;
|
||||
my $time = timegm( $sec, $min, $hour, $mday, $mon, $year_in );
|
||||
|
||||
my ( $s, $m, $h, $D, $M, $Y ) = gmtime($time);
|
||||
@@ -128,7 +127,6 @@ SKIP: {
|
||||
|
||||
for (@bad_time) {
|
||||
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
|
||||
- $year -= 1900;
|
||||
$mon--;
|
||||
|
||||
eval { timegm( $sec, $min, $hour, $mday, $mon, $year ) };
|
||||
@@ -138,19 +136,19 @@ for (@bad_time) {
|
||||
|
||||
{
|
||||
is(
|
||||
- timelocal( 0, 0, 1, 1, 0, 90 ) - timelocal( 0, 0, 0, 1, 0, 90 ), 3600,
|
||||
+ timelocal( 0, 0, 1, 1, 0, 1990 ) - timelocal( 0, 0, 0, 1, 0, 1990 ), 3600,
|
||||
'one hour difference between two calls to timelocal'
|
||||
);
|
||||
|
||||
is(
|
||||
- timelocal( 1, 2, 3, 1, 0, 100 ) - timelocal( 1, 2, 3, 31, 11, 99 ),
|
||||
+ timelocal( 1, 2, 3, 1, 0, 2000 ) - timelocal( 1, 2, 3, 31, 11, 1999 ),
|
||||
24 * 3600,
|
||||
'one day difference between two calls to timelocal'
|
||||
);
|
||||
|
||||
# Diff beween Jan 1, 1980 and Mar 1, 1980 = (31 + 29 = 60 days)
|
||||
is(
|
||||
- timegm( 0, 0, 0, 1, 2, 80 ) - timegm( 0, 0, 0, 1, 0, 80 ),
|
||||
+ timegm( 0, 0, 0, 1, 2, 1980 ) - timegm( 0, 0, 0, 1, 0, 1980 ),
|
||||
60 * 24 * 3600,
|
||||
'60 day difference between two calls to timegm'
|
||||
);
|
||||
Index: perl-5.26.1/cpan/libnet/lib/Net/FTP.pm
|
||||
===================================================================
|
||||
--- perl-5.26.1.orig/cpan/libnet/lib/Net/FTP.pm
|
||||
+++ perl-5.26.1/cpan/libnet/lib/Net/FTP.pm
|
||||
@@ -264,7 +264,7 @@ sub mdtm {
|
||||
|
||||
$ftp->_MDTM($file)
|
||||
&& $ftp->message =~ /((\d\d)(\d\d\d?))(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
|
||||
- ? timegm($8, $7, $6, $5, $4 - 1, $2 eq '19' ? $3 : ($1 - 1900))
|
||||
+ ? timegm($8, $7, $6, $5, $4 - 1, $2 eq '19' ? ($3 + 1900) : $1)
|
||||
: undef;
|
||||
}
|
||||
|
||||
Index: perl-5.26.1/cpan/libnet/lib/Net/NNTP.pm
|
||||
===================================================================
|
||||
--- perl-5.26.1.orig/cpan/libnet/lib/Net/NNTP.pm
|
||||
+++ perl-5.26.1/cpan/libnet/lib/Net/NNTP.pm
|
||||
@@ -598,7 +598,7 @@ sub date {
|
||||
|
||||
$nntp->_DATE
|
||||
&& $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
|
||||
- ? timegm($6, $5, $4, $3, $2 - 1, $1 - 1900)
|
||||
+ ? timegm($6, $5, $4, $3, $2 - 1, $1)
|
||||
: undef;
|
||||
}
|
||||
|
||||
Index: perl-5.26.1/pod/perlport.pod
|
||||
===================================================================
|
||||
--- perl-5.26.1.orig/pod/perlport.pod
|
||||
+++ perl-5.26.1/pod/perlport.pod
|
||||
@@ -670,7 +670,7 @@ When calculating specific times, such as
|
||||
it may be appropriate to calculate an offset for the epoch.
|
||||
|
||||
use Time::Local qw(timegm);
|
||||
- my $offset = timegm(0, 0, 0, 1, 0, 70);
|
||||
+ my $offset = timegm(0, 0, 0, 1, 0, 1970);
|
||||
|
||||
The value for C<$offset> in Unix will be C<0>, but in Mac OS Classic
|
||||
will be some large number. C<$offset> can then be added to a Unix time
|
35
perl-reproducible2.patch
Normal file
35
perl-reproducible2.patch
Normal file
@ -0,0 +1,35 @@
|
||||
commit 3b3217087ecdc7a51bfeba5233e1a4612da9ea5b
|
||||
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
|
||||
Date: Thu Dec 27 11:24:43 2018 +0100
|
||||
|
||||
Avoid recursion depth variations across builds
|
||||
|
||||
See https://reproducible-builds.org/ for why this is good.
|
||||
|
||||
Variations are likely coming from ASLR.
|
||||
|
||||
On an openSUSE Linux system, this changed
|
||||
$Storable::recursion_limit
|
||||
from varying between 14265 and 14267 to a constant 14256
|
||||
|
||||
There could be a chance for remaining variations.
|
||||
|
||||
---
|
||||
Better fixes welcome.
|
||||
|
||||
Index: perl-5.28.1/dist/Storable/stacksize
|
||||
===================================================================
|
||||
--- perl-5.28.1.orig/dist/Storable/stacksize
|
||||
+++ perl-5.28.1/dist/Storable/stacksize
|
||||
@@ -198,8 +198,8 @@ my $max_depth_hash = $n;
|
||||
# be fairly aggressive in trimming this, smoke testing showed several
|
||||
# several apparently random failures here, eg. working in one
|
||||
# configuration, but not in a very similar configuration.
|
||||
-$max_depth = int(0.6 * $max_depth);
|
||||
-$max_depth_hash = int(0.6 * $max_depth);
|
||||
+$max_depth = int(0.6 * $max_depth) & ~31;
|
||||
+$max_depth_hash = int(0.6 * $max_depth) & ~31;
|
||||
|
||||
my $stack_reserve = $^O eq "MSWin32" ? 32 : 16;
|
||||
if ($] ge "5.016" && !($^O eq "cygwin" && $ptrsize == 8)) {
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 23 23:01:19 UTC 2019 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Add perl-fix2020.patch to fix timelocal calls in 2020 (boo#1102840)
|
||||
- Add perl-reproducible2.patch to make build reproducible in spite of ASLR
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 30 14:12:53 CET 2018 - mls@suse.de
|
||||
|
||||
|
@ -47,6 +47,10 @@ Patch13: perl_skip_flaky_tests_powerpc.patch
|
||||
Patch14: posix-sigaction.patch
|
||||
Patch15: perl-gdbm-test-no-mmap.diff
|
||||
Patch16: perl-revert-caretx.diff
|
||||
# PATCH-FIX-UPSTREAM unmerged
|
||||
Patch17: perl-fix2020.patch
|
||||
# PATCH-FIX-UPSTREAM unmerged https://www.nntp.perl.org/group/perl.perl5.porters/2018/12/msg253240.html
|
||||
Patch18: perl-reproducible2.patch
|
||||
BuildRequires: db-devel
|
||||
BuildRequires: gdbm-devel
|
||||
BuildRequires: libbz2-devel
|
||||
@ -181,6 +185,8 @@ cp -p %{SOURCE3} .
|
||||
%patch14 -p1
|
||||
%patch15
|
||||
%patch16
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
|
||||
%build
|
||||
cp -a lib savelib
|
||||
|
Loading…
Reference in New Issue
Block a user