Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
perl.15357
perl-fix2020.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-fix2020.patch of Package perl.15357
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 | 14 ++++++-------- cpan/libnet/Net/FTP.pm | 2 +- cpan/libnet/Net/NNTP.pm | 2 +- pod/perlport.pod | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) --- ./cpan/Time-Local/t/Local.t +++ ./cpan/Time-Local/t/Local.t @@ -91,8 +91,7 @@ for (@time, @neg_time) { # Test timelocal() { - my $year_in = $year < 70 ? $year + 1900 : $year; - my $time = timelocal($sec,$min,$hour,$mday,$mon,$year_in); + my $time = timelocal($sec,$min,$hour,$mday,$mon,$year + 1900); my($s,$m,$h,$D,$M,$Y) = localtime($time); @@ -107,8 +106,7 @@ for (@time, @neg_time) { # Test timegm() { - my $year_in = $year < 70 ? $year + 1900 : $year; - my $time = timegm($sec,$min,$hour,$mday,$mon,$year_in); + my $time = timegm($sec,$min,$hour,$mday,$mon,$year + 1900); my($s,$m,$h,$D,$M,$Y) = gmtime($time); @@ -134,14 +132,14 @@ for (@bad_time) { } { - is(timelocal(0,0,1,1,0,90) - timelocal(0,0,0,1,0,90), 3600, + is(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), 24 * 3600, + is(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), 60 * 24 * 3600, + is(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'); } @@ -151,7 +149,7 @@ for (@bad_time) { # 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 ok($hour == 2 || $hour == 3, 'hour should be 2 or 3'); --- ./cpan/libnet/Net/FTP.pm +++ ./cpan/libnet/Net/FTP.pm @@ -200,7 +200,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/Net/NNTP.pm +++ ./cpan/libnet/Net/NNTP.pm @@ -536,7 +536,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 +++ ./pod/perlport.pod @@ -635,7 +635,7 @@ When calculating specific times, such as it may be appropriate to calculate an offset for the epoch. require Time::Local; - my $offset = Time::Local::timegm(0, 0, 0, 1, 0, 70); + my $offset = Time::Local::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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor