Bug#915209: Info received (perl: FTBFS in the year 2020: cpan/Time-Local/t/Local.t failure)

2020-01-14 Thread Niko Tyni
On Tue, Jan 14, 2020 at 03:26:33PM +1100, Dean Hamstead wrote:
> The attached patch is for 5.24.1 old-stable and is derived from
> https://rt.cpan.org/Public/Bug/Display.html?id=124787

Thanks! I'll try to get this in the next oldstable point release,
currently scheduled for February.
-- 
Niko Tyni   nt...@debian.org



Bug#915209: Info received (perl: FTBFS in the year 2020: cpan/Time-Local/t/Local.t failure)

2020-01-13 Thread Dean Hamstead
The attached patch is for 5.24.1 old-stable and is derived from 
https://rt.cpan.org/Public/Bug/Display.html?id=124787


Offered under the same license as perl

Perhaps it will help someone



On 2020-01-13 15:15, Debian Bug Tracking System wrote:

Thank you for the additional information you have supplied regarding
this Bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Niko Tyni 

If you wish to submit further information on this problem, please
send it to 915...@bugs.debian.org.

Please do not send mail to ow...@bugs.debian.org unless you wish
to report a problem with the Bug-tracking system.Index: perl-5.24.1/cpan/Time-Local/t/Local.t
===
--- perl-5.24.1.orig/cpan/Time-Local/t/Local.t
+++ perl-5.24.1/cpan/Time-Local/t/Local.t
@@ -91,7 +91,7 @@ for (@time, @neg_time) {
 
 # Test timelocal()
 {
-my $year_in = $year < 70 ? $year + 1900 : $year;
+my $year_in = $year + 1900;
 my $time = timelocal($sec,$min,$hour,$mday,$mon,$year_in);
 
 my($s,$m,$h,$D,$M,$Y) = localtime($time);
@@ -107,7 +107,7 @@ for (@time, @neg_time) {
 
 # Test timegm()
 {
-my $year_in = $year < 70 ? $year + 1900 : $year;
+my $year_in = $year + 1900;
 my $time = timegm($sec,$min,$hour,$mday,$mon,$year_in);
 
 my($s,$m,$h,$D,$M,$Y) = gmtime($time);
@@ -125,7 +125,6 @@ for (@time, @neg_time) {
 
 for (@bad_time) {
 my($year, $mon, $mday, $hour, $min, $sec) = @$_;
-$year -= 1900;
 $mon--;
 
 eval { timegm($sec,$min,$hour,$mday,$mon,$year) };
@@ -134,14 +133,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');
 }