From 7b493b7ec8625db63c8a4ea81f77b734a8ef369f Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mar 24 2016 14:05:13 +0000 Subject: 1.97 bump --- diff --git a/DateTime-TimeZone-1.83-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch b/DateTime-TimeZone-1.83-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch deleted file mode 100644 index 56cd6b0..0000000 --- a/DateTime-TimeZone-1.83-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch +++ /dev/null @@ -1,78 +0,0 @@ -From fbf080cb5ca92f35a594967bdd3764c7dbb8c7f7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Mon, 1 Sep 2014 17:37:12 +0200 -Subject: [PATCH] Parse /etc/localtime by DateTime::TimeZone::Tzfile -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If there is valid /etc/localtime, then the system has configured local -time. If the file is not a symlink to /usr/share/zoneinfo or a copy -from there, then it's still a valid configuration. The only issue is -one cannot know the time zone name (Unfortunately, the time zone -abbreviations are ambiguous.) - -This patch implements this scenario and caused returning - a DateTime::TimeZone::Tzfile object instead of dying with -"Cannot determine local time zone" message. - -Signed-off-by: Petr Písař ---- - lib/DateTime/TimeZone/Local/Unix.pm | 27 +++++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - -diff --git a/lib/DateTime/TimeZone/Local/Unix.pm b/lib/DateTime/TimeZone/Local/Unix.pm -index ae26fae..c5d44fe 100644 ---- a/lib/DateTime/TimeZone/Local/Unix.pm -+++ b/lib/DateTime/TimeZone/Local/Unix.pm -@@ -16,6 +16,7 @@ sub Methods { - FromEtcTIMEZONE - FromEtcSysconfigClock - FromEtcDefaultInit -+ FromEtcLocaltimeContent - ); - } - -@@ -237,6 +238,25 @@ sub _ReadEtcDefaultInit { - } - } - -+sub FromEtcLocaltimeContent { -+ my $class = shift; -+ -+ my $lt_file = $class->_EtcFile('localtime'); -+ return unless -r $lt_file && -s $lt_file && ! -l $lt_file; -+ -+ my $tz; -+ { -+ local $@; -+ local $SIG{__DIE__}; -+ $tz = eval { -+ require DateTime::TimeZone::Tzfile; -+ DateTime::TimeZone::Tzfile->new($lt_file); -+ }; -+ } -+ -+ return $tz if $tz; -+} -+ - 1; - - # ABSTRACT: Determine the local system's time zone on Unix -@@ -309,6 +329,13 @@ a time zone name. - If this file exists, it is opened and we look for a line starting like - "TZ=...". If this is found, it should indicate a time zone name. - -+=item * F content -+ -+If this file is not a symlink, it's parsed by -+a L to retrieve the time zone offset -+definition. No time zone name will be defined. This is usefull if the -+file does not present in the system time zone database. -+ - =back - - =head1 AUTHOR --- -1.9.3 - diff --git a/DateTime-TimeZone-1.97-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch b/DateTime-TimeZone-1.97-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch new file mode 100644 index 0000000..92559b4 --- /dev/null +++ b/DateTime-TimeZone-1.97-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch @@ -0,0 +1,78 @@ +From fbf080cb5ca92f35a594967bdd3764c7dbb8c7f7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 1 Sep 2014 17:37:12 +0200 +Subject: [PATCH] Parse /etc/localtime by DateTime::TimeZone::Tzfile +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If there is valid /etc/localtime, then the system has configured local +time. If the file is not a symlink to /usr/share/zoneinfo or a copy +from there, then it's still a valid configuration. The only issue is +one cannot know the time zone name (Unfortunately, the time zone +abbreviations are ambiguous.) + +This patch implements this scenario and caused returning + a DateTime::TimeZone::Tzfile object instead of dying with +"Cannot determine local time zone" message. + +Signed-off-by: Petr Písař +--- + lib/DateTime/TimeZone/Local/Unix.pm | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/lib/DateTime/TimeZone/Local/Unix.pm b/lib/DateTime/TimeZone/Local/Unix.pm +index ae26fae..c5d44fe 100644 +--- a/lib/DateTime/TimeZone/Local/Unix.pm ++++ b/lib/DateTime/TimeZone/Local/Unix.pm +@@ -16,6 +16,7 @@ sub Methods { + FromEtcTIMEZONE + FromEtcSysconfigClock + FromEtcDefaultInit ++ FromEtcLocaltimeContent + ); + } + +@@ -237,6 +238,25 @@ sub _ReadEtcDefaultInit { + } + } + ++sub FromEtcLocaltimeContent { ++ my $class = shift; ++ ++ my $lt_file = $class->_EtcFile('localtime'); ++ return unless -r $lt_file && -s $lt_file && ! -l $lt_file; ++ ++ my $tz; ++ { ++ local $@; ++ local $SIG{__DIE__}; ++ $tz = eval { ++ require DateTime::TimeZone::Tzfile; ++ DateTime::TimeZone::Tzfile->new($lt_file); ++ }; ++ } ++ ++ return $tz if $tz; ++} ++ + 1; + + # ABSTRACT: Determine the local system's time zone on Unix +@@ -311,6 +331,13 @@ a time zone name. + If this file exists, it is opened and we look for a line starting like + "TZ=...". If this is found, it should indicate a time zone name. + ++=item * F content ++ ++If this file is not a symlink, it's parsed by ++a L to retrieve the time zone offset ++definition. No time zone name will be defined. This is usefull if the ++file does not present in the system time zone database. ++ + =back + + =head1 SUPPORT +-- +1.9.3 + diff --git a/perl-DateTime-TimeZone.spec b/perl-DateTime-TimeZone.spec index ab817fd..086b876 100644 --- a/perl-DateTime-TimeZone.spec +++ b/perl-DateTime-TimeZone.spec @@ -1,5 +1,5 @@ Name: perl-DateTime-TimeZone -Version: 1.96 +Version: 1.97 Release: 1%{?dist} Summary: Time zone object base class and factory License: GPL+ or Artistic @@ -8,7 +8,7 @@ URL: http://search.cpan.org/dist/DateTime-TimeZone/ Source0: http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-TimeZone-%{version}.tar.gz # Parse local time zone definition from /etc/localtime as before giving up, # bug #1135981, CPAN RT#55029 -Patch0: DateTime-TimeZone-1.83-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch +Patch0: DateTime-TimeZone-1.97-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch BuildArch: noarch # Build BuildRequires: make @@ -92,8 +92,11 @@ make test %{_mandir}/man3/* %changelog +* Thu Mar 24 2016 Jitka Plesnikova - 1.97-1 +- 1.97 bump (2016c Olson database) + * Wed Mar 16 2016 Jitka Plesnikova - 1.96-1 -- 1.96 bump +- 1.96 bump (2016b Olson database) * Thu Feb 04 2016 Fedora Release Engineering - 1.95-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index f199de8..ffa05de 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -033984289cd38f373b1ad8b0c3fadb3d DateTime-TimeZone-1.96.tar.gz +51dacb4bcc21d4d603ab08e50a5aeb7a DateTime-TimeZone-1.97.tar.gz