Hello community, here is the log from the commit of package perl-TimeDate for openSUSE:Leap:15.2 checked in at 2020-06-14 04:44:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/perl-TimeDate (Old) and /work/SRC/openSUSE:Leap:15.2/.perl-TimeDate.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-TimeDate" Sun Jun 14 04:44:33 2020 rev:18 rq:814116 version:2.30 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/perl-TimeDate/perl-TimeDate.changes 2020-03-01 08:51:21.113270625 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.perl-TimeDate.new.3606/perl-TimeDate.changes 2020-06-14 04:44:37.406700072 +0200 @@ -1,0 +2,6 @@ +Thu Jun 11 12:20:59 UTC 2020 - Pedro Monreal Gonzalez <[email protected]> + +- Parse out century if specified (strptime) [bsc#1172834] +- Add perl-TimeDate-parse-out-century-if-specified.patch + +------------------------------------------------------------------- New: ---- perl-TimeDate-parse-out-century-if-specified.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-TimeDate.spec ++++++ --- /var/tmp/diff_new_pack.5FpcJ0/_old 2020-06-14 04:44:37.734701138 +0200 +++ /var/tmp/diff_new_pack.5FpcJ0/_new 2020-06-14 04:44:37.738701152 +0200 @@ -27,6 +27,8 @@ Source0: https://cpan.metacpan.org/authors/id/G/GB/GBARR/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml Patch0: perl-TimeDate-getdate.patch +# PATCH-FIX-UPSTREAM bsc#1172834 Parse out century if specified (strptime) +Patch1: perl-TimeDate-parse-out-century-if-specified.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl @@ -53,6 +55,7 @@ %setup -q -n %{cpan_name}-%{version} find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644 %patch0 -p1 +%patch1 -p1 %build %{__perl} Makefile.PL INSTALLDIRS=vendor ++++++ perl-TimeDate-parse-out-century-if-specified.patch ++++++ >From d7450983cbc7ea9d54662c9a181824d3e8bcfbf3 Mon Sep 17 00:00:00 2001 From: Jonathan Scott Duff <[email protected]> Date: Sun, 1 Mar 2015 23:43:25 -0600 Subject: [PATCH] [strptime] Parse out century if specified If we've been given a year that's got the century attached (i.e., the year is > 1900), store the century. Then use this information to defeat the guessing behavior of timegm. --- lib/Date/Parse.pm | 20 +++++++++++++------- t/cpanrt.t | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) Index: TimeDate-2.30/lib/Date/Parse.pm =================================================================== --- TimeDate-2.30.orig/lib/Date/Parse.pm +++ TimeDate-2.30/lib/Date/Parse.pm @@ -73,7 +73,7 @@ sub { my $dtstr = lc shift; my $merid = 24; - my($year,$month,$day,$hh,$mm,$ss,$zone,$dst,$frac); + my($century,$year,$month,$day,$hh,$mm,$ss,$zone,$dst,$frac); $zone = tz_offset(shift) if @_; @@ -195,12 +195,15 @@ sub { } } - $year -= 1900 if defined $year && $year > 2000; + if (defined $year && $year > 1900) { + $century = int($year / 100); + $year -= 1900; + } $zone += 3600 if defined $zone && $dst; $ss += "0.$frac" if $frac; - return ($ss,$mm,$hh,$day,$month,$year,$zone); + return ($ss,$mm,$hh,$day,$month,$year,$zone,$century); } ESQ @@ -233,7 +236,7 @@ sub str2time return undef unless @t; - my($ss,$mm,$hh,$day,$month,$year,$zone) = @t; + my($ss,$mm,$hh,$day,$month,$year,$zone, $century) = @t; my @lt = localtime(time); $hh ||= 0; @@ -252,6 +255,9 @@ sub str2time $year = ($month > $lt[4]) ? ($lt[5] - 1) : $lt[5] unless(defined $year); + # we were given a 4 digit year, so let's keep using those + $year += 1900 if defined $century; + return undef unless($month <= 11 && $day >= 1 && $day <= 31 && $hh <= 23 && $mm <= 59 && $ss <= 59); @@ -317,9 +323,9 @@ date string does not specify a timezone. =item strptime(DATE [, ZONE]) C<strptime> takes the same arguments as str2time but returns an array of -values C<($ss,$mm,$hh,$day,$month,$year,$zone)>. Elements are only defined -if they could be extracted from the date string. The C<$zone> element is -the timezone offset in seconds from GMT. An empty array is returned upon +values C<($ss,$mm,$hh,$day,$month,$year,$zone,$century)>. Elements are only +defined if they could be extracted from the date string. The C<$zone> element +is the timezone offset in seconds from GMT. An empty array is returned upon failure. =head1 MULTI-LANGUAGE SUPPORT Index: TimeDate-2.30/t/cpanrt.t =================================================================== --- TimeDate-2.30.orig/t/cpanrt.t +++ TimeDate-2.30/t/cpanrt.t @@ -22,7 +22,7 @@ my $i = 1; my @t = strptime($str); my $t = join ":", map { defined($_) ? $_ : "-" } @t; print "# $str => $t\n"; - print "not " unless $t eq "-:35:22:30:10:108:3600"; + print "not " unless $t eq "-:35:22:30:10:108:3600:20"; print "ok ", $i++, "\n"; } }
