[dw-free] Add check for system time being GMT to checkconfig
[commit: http://hg.dwscoalition.org/dw-free/rev/0bf25921a21f]
http://bugs.dwscoalition.org/show_bug.cgi?id=3785
Check for system time using DateTime::TimeZone.
Patch by
rb.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3785
Check for system time using DateTime::TimeZone.
Patch by
Files modified:
- bin/checkconfig.pl
--------------------------------------------------------------------------------
diff -r db3e6ad361a8 -r 0bf25921a21f bin/checkconfig.pl
--- a/bin/checkconfig.pl Tue Nov 08 22:06:08 2011 -0600
+++ b/bin/checkconfig.pl Fri Nov 11 11:41:42 2011 +0800
@@ -22,6 +22,7 @@
my %dochecks; # these are the ones we'll actually do
my @checks = ( # put these in the order they should be checked in
+ "timezone",
"modules",
"env",
"database",
@@ -50,6 +51,7 @@
if ($debs_only) {
$dochecks{ljconfig} = 0;
$dochecks{database} = 0;
+ $dochecks{timezone} = 0;
}
usage() if $only_check && $no_check;
@@ -221,6 +223,7 @@
'opt' => "Required for taking credit/debit cards in the shop.",
},
"Hash::MultiValue" => {},
+ "DateTime::TimeZone" => { 'deb' => "libdatetime-timezone-perl", },
"Sys::Syscall" => { dev => 'libsys-syscall-perl' },
"Danga::Socket" => { dev => 'libdanga-socket-perl' },
"IO::AIO" => { dev => 'libio-aoi-perl' },
@@ -369,3 +372,15 @@
print "NOTE: checkconfig.pl doesn't check everything yet\n";
}
+sub check_timezone {
+ print "[Checking Timezone...]\n";
+ my $rv = eval "use DateTime::TimeZone;";
+ if ($@) {
+ $err->( "Missing required perl module: DateTime::TimeZone" );
+ }
+
+ my $timezone = DateTime::TimeZone->new( name => 'local' );
+
+ $err->( "Timezone must be UTC." ) unless $timezone->is_utc;
+}
+
--------------------------------------------------------------------------------

no subject
no subject