Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 933831 Details for
Bug 1135981
DateTime::TimeZone::Local->TimeZone does not use /etc/locatime content (Cannot determine local time zone)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix
DateTime-TimeZone-1.74-Parse-etc-localtime-by-DateTime-TimeZone-Tzfile.patch (text/plain), 2.30 KB, created by
Petr Pisar
on 2014-09-02 15:33:33 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2014-09-02 15:33:33 UTC
Size:
2.30 KB
patch
obsolete
>From ddb36a17bd9ab30c33532684af85c71cd5c04071 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >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Å <ppisar@redhat.com> >--- > 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 71d7d4e..3c24ad0 100644 >--- a/lib/DateTime/TimeZone/Local/Unix.pm >+++ b/lib/DateTime/TimeZone/Local/Unix.pm >@@ -14,6 +14,7 @@ sub Methods { > FromEtcTIMEZONE > FromEtcSysconfigClock > FromEtcDefaultInit >+ FromEtcLocaltimeContent > ); > } > >@@ -233,6 +234,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 >@@ -307,6 +327,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</etc/localtime> content >+ >+If this file is not a symlink, it's parsed by >+a L<DateTime::TimeZone::Tzfile> 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 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1135981
: 933831