Accepting request 762957 from home:bmwiedemann:branches:devel:languages:perl

- Extend perl-TimeDate-getdate.patch to fix another year-2020 bug
  (bsc#1159990)
or should we file a new bug, because it needs to be submitted as maintenance update?

OBS-URL: https://build.opensuse.org/request/show/762957
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-TimeDate?expand=0&rev=30
This commit is contained in:
Pedro Monreal Gonzalez 2020-01-13 09:30:59 +00:00 committed by Git OBS Bridge
parent 6126567c46
commit b13e8fc56b
2 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,7 @@
From: Bernhard M. Wiedemann <bwiedemann suse de>
Subject: Fix bsc#1159990
Date: 2020-01-11
Index: TimeDate-2.30/t/getdate.t
===================================================================
--- TimeDate-2.30.orig/t/getdate.t
@ -11,3 +15,41 @@ Index: TimeDate-2.30/t/getdate.t
@data = split(/\n/, $data);
Index: TimeDate-2.30/t/cpanrt.t
===================================================================
--- TimeDate-2.30.orig/t/cpanrt.t
+++ TimeDate-2.30/t/cpanrt.t
@@ -1,7 +1,7 @@
use Date::Format qw(time2str strftime);
use Date::Parse qw(strptime str2time);
-print "1..8\n";
+print "1..10\n";
my $i = 1;
@@ -53,3 +53,11 @@ my $i = 1;
print "not " if str2time('16 Oct 09') < 0;
print "ok ", $i++, "\n";
}
+
+{ # https://rt.cpan.org/Public/Bug/Display.html?id=124509 year 2020 problem
+ print "# 1970-01-01 => 0\n";
+ print "not " if str2time('1970-01-01') != 0;
+ print "ok ", $i++, "\n";
+ print "not " if str2time('01 Jan 70') == 0;
+ print "ok ", $i++, "\n";
+}
Index: TimeDate-2.30/lib/Date/Parse.pm
===================================================================
--- TimeDate-2.30.orig/lib/Date/Parse.pm
+++ TimeDate-2.30/lib/Date/Parse.pm
@@ -195,7 +195,7 @@ sub {
}
}
- $year -= 1900 if defined $year && $year > 1900;
+ $year -= 1900 if defined $year && $year > 2000;
$zone += 3600 if defined $zone && $dst;
$ss += "0.$frac" if $frac;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Jan 11 04:10:44 UTC 2020 - Bernhard Wiedemann <bwiedemann@suse.com>
- Extend perl-TimeDate-getdate.patch to fix another year-2020 bug
(bsc#1159990)
-------------------------------------------------------------------
Thu Jan 2 12:42:40 UTC 2020 - Pedro Monreal Gonzalez <pmonrealgonzalez@suse.com>