svn commit: r446961 - in head/finance/gnucash: . files

Guido Falsi madpilot at FreeBSD.org
Mon Jul 31 15:07:04 UTC 2017


Author: madpilot
Date: Mon Jul 31 15:07:02 2017
New Revision: 446961
URL: https://svnweb.freebsd.org/changeset/ports/446961

Log:
  Apply patch submitted upstream to better emulate the USG UNIX
  daylight global variable as implemented in glibc.
  
  Obtained from:	https://github.com/Gnucash/gnucash/pull/116

Modified:
  head/finance/gnucash/Makefile
  head/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c

Modified: head/finance/gnucash/Makefile
==============================================================================
--- head/finance/gnucash/Makefile	Mon Jul 31 14:50:40 2017	(r446960)
+++ head/finance/gnucash/Makefile	Mon Jul 31 15:07:02 2017	(r446961)
@@ -3,6 +3,7 @@
 
 PORTNAME=	gnucash
 PORTVERSION=	2.6.17
+PORTREVISION=	1
 CATEGORIES=	finance gnome
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}%20%28stable%29/${PORTVERSION}
 

Modified: head/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c
==============================================================================
--- head/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c	Mon Jul 31 14:50:40 2017	(r446960)
+++ head/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c	Mon Jul 31 15:07:02 2017	(r446961)
@@ -1,12 +1,26 @@
 --- src/import-export/ofx/gnc-ofx-import.c.orig	2016-12-15 21:46:51 UTC
 +++ src/import-export/ofx/gnc-ofx-import.c
-@@ -337,7 +337,11 @@ fix_ofx_bug_39 (time64 t)
+@@ -336,8 +336,25 @@ fix_ofx_bug_39 (time64 t)
+ {
  #if HAVE_OFX_BUG_39
      struct tm stm;
-     gnc_localtime_r(&t, &stm);
++
 +#ifdef __FreeBSD__
-+    if (!stm.tm_isdst)
++    time64 now;
++    /*
++     * FreeBSD has it's own libc implementation which differs from glibc. In particular:
++     * There is no daylight global
++     * tzname members are set to the string "   " (three spaces) when not explicitly populated
++     *
++     * To check that the current timezone does not observe DST I check if tzname[1] starts with a space.
++     */
++    now = gnc_time (NULL);
++    gnc_localtime_r(&now, &stm);
++    tzset();
++
++    if (tzname[1][0] != ' ' && !stm.tm_isdst)
 +#else
+     gnc_localtime_r(&t, &stm);
      if (daylight && !stm.tm_isdst)
 +#endif
        t += 3600;


More information about the svn-ports-all mailing list