]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
If neither timezone nor TZ is set, set both to :/etc/localtime if we're on a GNU...
authorSimon McVittie <smcv@debian.org>
Sun, 1 Mar 2015 14:56:45 +0000 (14:56 +0000)
committerSimon McVittie <smcv@debian.org>
Sun, 1 Mar 2015 15:01:05 +0000 (15:01 +0000)
IkiWiki.pm
debian/changelog

index 7afd57993a706d0324c758943450af8c0b3eb583..f414996db377d12a27dc7c408a766e6302b9cf02 100644 (file)
@@ -619,9 +619,20 @@ sub checkconfig () {
        if (defined $config{timezone} && length $config{timezone}) {
                $ENV{TZ}=$config{timezone};
        }
-       else {
+       elsif (defined $ENV{TZ} && length $ENV{TZ}) {
                $config{timezone}=$ENV{TZ};
        }
+       else {
+               eval q{use Config qw()};
+               error($@) if $@;
+
+               if ($Config::Config{d_gnulibc} && -e '/etc/localtime') {
+                       $config{timezone}=$ENV{TZ}=':/etc/localtime';
+               }
+               else {
+                       $config{timezone}=$ENV{TZ}='GMT';
+               }
+       }
 
        if ($config{w3mmode}) {
                eval q{use Cwd q{abs_path}};
index fbb5e7f2129255214afe29e44cba0729d3bfb53b..8dc5790fc15702bd2d522270178206adca9eab53 100644 (file)
@@ -8,6 +8,8 @@ ikiwiki (3.20150108) UNRELEASED; urgency=medium
     bundle an old enough Encode.pm for that not to be a problem: the
     system might have a newer Encode.pm installed separately, like Fedora 20.
     (Closes: #776181; thanks, Anders Kaseorg)
+  * If neither timezone nor TZ is set, set both to :/etc/localtime if
+    we're on a GNU system and that file exists, or GMT otherwise
 
  -- Joey Hess <id@joeyh.name>  Sat, 24 Jan 2015 23:59:20 -0400