r16035 - gnucash/trunk - Do not set timezone to UTC on Windows, #434752.
Andreas Köhler
andi5 at cvs.gnucash.org
Tue May 1 10:03:44 EDT 2007
Author: andi5
Date: 2007-05-01 10:03:44 -0400 (Tue, 01 May 2007)
New Revision: 16035
Trac: http://svn.gnucash.org/trac/changeset/16035
Modified:
gnucash/trunk/packaging/win32/install-fq-mods.bat
gnucash/trunk/src/bin/gnucash-bin.c
gnucash/trunk/src/quotes/gnc-fq-helper.in
Log:
Do not set timezone to UTC on Windows, #434752.
The perl module Date::Manip needs some timezone information to work, but
cannot determine that itself on Windows. Setting the TZ environment
variable for the gnucash process has bad consequences, so rather call
Date_Init("TZ=UTC") if TZ is unset.
Modified: gnucash/trunk/packaging/win32/install-fq-mods.bat
===================================================================
--- gnucash/trunk/packaging/win32/install-fq-mods.bat 2007-05-01 11:54:58 UTC (rev 16034)
+++ gnucash/trunk/packaging/win32/install-fq-mods.bat 2007-05-01 14:03:44 UTC (rev 16035)
@@ -26,6 +26,7 @@
echo * Install Finance-Quote
echo.
perl -x -S ppm install Finance-Quote
+if %errorlevel% neq 0 goto error
echo.
echo * Run gnc-fq-check
@@ -33,18 +34,11 @@
perl -w gnc-fq-check
if %errorlevel% neq 0 goto error
-set OLDTZ=%TZ%
-set TZ
-if %errorlevel% neq 1 goto cfqh
-set TZ=UTC
-:cfqh
echo.
echo * Run gnc-fq-helper
echo.
echo (yahoo "AMZN") | perl -w gnc-fq-helper
-set errlvlbak=%errorlevel%
-set TZ=%OLDTZ%
-if %errlvlbak% neq 0 goto error
+if %errorlevel% neq 0 goto error
echo.
echo * Installation succeeded
Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c 2007-05-01 11:54:58 UTC (rev 16034)
+++ gnucash/trunk/src/bin/gnucash-bin.c 2007-05-01 14:03:44 UTC (rev 16035)
@@ -117,8 +117,6 @@
g_setenv("PATHEXT", pathext, TRUE);
g_free(pathext);
}
- /* this is needed by Date::Manip and will not hurt */
- g_setenv("TZ", "UTC", FALSE);
#endif
}
Modified: gnucash/trunk/src/quotes/gnc-fq-helper.in
===================================================================
--- gnucash/trunk/src/quotes/gnc-fq-helper.in 2007-05-01 11:54:58 UTC (rev 16034)
+++ gnucash/trunk/src/quotes/gnc-fq-helper.in 2007-05-01 14:03:44 UTC (rev 16035)
@@ -323,6 +323,9 @@
# Check for and load non-standard modules
check_modules ();
+# Help Date::Manip on Windows
+Date_Init("TZ=UTC") if ($^O eq "MSWin32" && (!$ENV{'TZ'}));
+
# Create a stockquote object.
my $quoter = Finance::Quote->new();
my $prgnam = "gnc-fq-helper";
More information about the gnucash-changes
mailing list