SHA256
1
0
forked from pool/perl
perl/perl-fix2020.patch
Michael Schröder 35bc659799 - update to perl-5.30.1
* unicode 12.1 is supported
  * turkic UTF-8 locales are now seamlessly supported
  * assigning non-zero to $[ is fatal
  * some formerly deprecated uses of an unescaped left brace "{" in
    regular expression patterns are now illegal
  * previously deprecated sysread()/syswrite() on :utf8 handles is 
    now fatal
  * my() in false conditional prohibited
  * remove File::Glob::glob()
  * various performance enhancements
- updated patches:
  * perl-5.22.0_wrong_rpm_provides.diff
  * perl-gdbm-test-no-mmap.diff
  * perl-fix2020.patch
  * perl-reproducible2.patch
- dropped patches:
  * perl-revert-caretx.diff
  * perl-regexp-refoverflow.diff

OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl?expand=0&rev=182
2019-11-19 14:17:02 +00:00

86 lines
3.3 KiB
Diff

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.cp
an.org/Public/Bug/Display.html?id=124534
https://rt.perl.org/Ticket/Display.html?id=132897 perl doc
--- ./cpan/Time-Local/t/Local.t.orig 2019-11-19 13:44:13.231729499 +0000
+++ ./cpan/Time-Local/t/Local.t 2019-11-19 13:52:27.846523342 +0000
@@ -147,21 +147,21 @@ subtest(
'diff between two calls',
sub {
is(
- timelocal( 0, 0, 1, 1, 0, 90 ) - timelocal( 0, 0, 0, 1, 0, 90 ),
+ 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'
);
@@ -176,7 +176,7 @@ subtest(
# treated like 03:00:00 rather than 01:00:00 - negative zone offsets
# used to do the latter.
{
- my $hour = ( localtime( timelocal( 0, 0, 2, 7, 3, 102 ) ) )[2];
+ my $hour = ( localtime( timelocal( 0, 0, 2, 7, 3, 2002 ) ) )[2];
# testers in US/Pacific should get 3,
# other testers should get 2
--- ./cpan/libnet/lib/Net/FTP.pm.orig 2019-11-19 13:47:09.143300523 +0000
+++ ./cpan/libnet/lib/Net/FTP.pm 2019-11-19 13:47:46.179210211 +0000
@@ -262,7 +262,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;
}
--- ./cpan/libnet/lib/Net/NNTP.pm.orig 2019-11-19 13:47:57.431182773 +0000
+++ ./cpan/libnet/lib/Net/NNTP.pm 2019-11-19 13:48:08.143156648 +0000
@@ -596,7 +596,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;
}
--- ./pod/perlport.pod.orig 2019-11-19 13:48:45.327065973 +0000
+++ ./pod/perlport.pod 2019-11-19 13:48:49.983054613 +0000
@@ -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