gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon Dec 14 16:12:01 EST 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/5f0cb073 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9f3d6fc8 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e08d7ac6 (commit)



commit 5f0cb0731f86c57ed5be0198167d538a52b2bb34
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Dec 14 12:46:09 2015 -0800

    Use @SHELL@ instead of hardcode /bin/sh in test shell scripts.
    
    This is a workaround for MacOS X 10.11's System Integrity Protection,
    aka SIP, which among other things prevents system binaries from passing
    linker environment variables to children. Anything in /bin or /usr/bin
    qualifies as a system binary, and that includes /bin/sh and /bin/bash.
    Not being able to pass linker paths breaks all of our guile tests which
    need to tell Guile where to look for the libraries being tested.
    
    To apply the workaround one needs to first have a shell outside of /bin
    and /usr/bin. Simply copying /bin/sh to your home direcory works, as
    does building a suitable shell somewhere. Just pass the path to that
    shell in $CONFIG_SHELL to configure and all of the shell scripts and
    libtool .la files will be created with it in the shebang line and the
    linker environment variables will be passed in.
    
    In order to build GnuCash in the first place you'll also need to edit
    guild to use the alternate shell.

diff --git a/configure.ac b/configure.ac
index 4eec91d..17f3737 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1377,7 +1377,6 @@ chmod u+x ${srcdir}/src/bin/generate-gnc-script
 # the ANSI2KNR-filtering rules.
 LIBOBJS_SEDSCRIPT="s,\.[[^.]]* ,$U&,g;s,\.[[^.]]*\$\$,$U&,"
 AC_SUBST(LIBOBJS_SEDSCRIPT)
-
 # Don't add empty lines in the following macro, they
 # will cause the Windows build to fail if using a git repo as source
 AC_CONFIG_FILES(
@@ -1569,6 +1568,48 @@ AC_CONFIG_FILES(
   ,
   dnl # init-commands go here
 )
+dnl # Shell scripts, to have their shells set
+AC_CONFIG_FILES([src/app-utils/test/test-load-module],
+                [chmod +x src/app-utils/test/test-load-module])
+AC_CONFIG_FILES([src/backend/xml/test/test-real-data.sh],
+                [chmod +x src/backend/xml/test/test-real-data.sh])
+AC_CONFIG_FILES([src/bin/test/test-version],
+                [chmod +x src/bin/test/test-version])
+AC_CONFIG_FILES([src/engine/test/test-create-account],
+                [chmod +x src/engine/test/test-create-account])
+AC_CONFIG_FILES([src/engine/test/test-scm-query-import],
+                [chmod +x src/engine/test/test-scm-query-import])
+AC_CONFIG_FILES([src/gnc-module/test/test-gwrapped-c],
+                [chmod +x src/gnc-module/test/test-gwrapped-c])
+AC_CONFIG_FILES([src/gnc-module/test/test-load-deps],
+                [chmod +x src/gnc-module/test/test-load-deps])
+AC_CONFIG_FILES([src/gnc-module/test/test-load-scm],
+                [chmod +x src/gnc-module/test/test-load-scm])
+AC_CONFIG_FILES([src/gnc-module/test/test-scm-dynload],
+                [chmod +x src/gnc-module/test/test-scm-dynload])
+AC_CONFIG_FILES([src/gnc-module/test/test-scm-init],
+                [chmod +x src/gnc-module/test/test-scm-init])
+AC_CONFIG_FILES([src/gnc-module/test/test-scm-module],
+                [chmod +x src/gnc-module/test/test-scm-module])
+AC_CONFIG_FILES([src/gnc-module/test/test-scm-multi],
+                [chmod +x src/gnc-module/test/test-scm-multi])
+AC_CONFIG_FILES([src/gnome-utils/test/test-load-module],
+                [chmod +x src/gnome-utils/test/test-load-module])
+AC_CONFIG_FILES([src/report/locale-specific/us/test/test-load-module],
+                [src/report/locale-specific/us/test/test-load-module])
+AC_CONFIG_FILES([src/report/report-gnome/test/test-load-module],
+                [chmod +x src/report/report-gnome/test/test-load-module])
+AC_CONFIG_FILES([src/report/report-system/test/test-load-module],
+                [chmod +x src/report/report-system/test/test-load-module])
+AC_CONFIG_FILES([src/report/standard-reports/test/test-load-module],
+                [chmod +x src/report/standard-reports/test/test-load-module])
+AC_CONFIG_FILES([src/report/stylesheets/test/test-load-module],
+                [chmod +x src/report/stylesheets/test/test-load-module])
+AC_CONFIG_FILES([src/report/utility-reports/test/test-load-module],
+                [chmod +x src/report/utility-reports/test/test-load-module])
+AC_CONFIG_FILES([src/tax/us/test/test-load-module],
+                [chmod +x src/tax/us/test/test-load-module])
+
 # A few files need extra actions at creation time
 AC_CONFIG_FILES([src/bin/overrides/gnucash-make-guids], [chmod u+x src/bin/overrides/gnucash-make-guids])
 LDFLAGS="${LDFLAGS} ${NOUNDEF}"
diff --git a/src/app-utils/test/test-load-module b/src/app-utils/test/test-load-module.in
similarity index 99%
rename from src/app-utils/test/test-load-module
rename to src/app-utils/test/test-load-module.in
index ea4ac23..5d6bb0e 100755
--- a/src/app-utils/test/test-load-module
+++ b/src/app-utils/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 exec ${GUILE} -s "$0" 
 !#
 
diff --git a/src/backend/xml/test/test-real-data.sh b/src/backend/xml/test/test-real-data.sh.in
similarity index 98%
rename from src/backend/xml/test/test-real-data.sh
rename to src/backend/xml/test/test-real-data.sh.in
index ff7bf3b..0c273bf 100755
--- a/src/backend/xml/test/test-real-data.sh
+++ b/src/backend/xml/test/test-real-data.sh.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
 
 #set -e
 
diff --git a/src/bin/test/test-version b/src/bin/test/test-version.in
similarity index 91%
rename from src/bin/test/test-version
rename to src/bin/test/test-version.in
index 59f9382..d5b1356 100755
--- a/src/bin/test/test-version
+++ b/src/bin/test/test-version.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! @SHELL@
 GUILE_WARN_DEPRECATED="no"
 export GUILE_WARN_DEPRECATED
 
diff --git a/src/engine/test/test-create-account b/src/engine/test/test-create-account.in
similarity index 87%
rename from src/engine/test/test-create-account
rename to src/engine/test/test-create-account.in
index 1666a2f..a9db9aa 100755
--- a/src/engine/test/test-create-account
+++ b/src/engine/test/test-create-account.in
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!@SHELL@
 ${GUILE} -l $SRCDIR/test-create-account.scm -c "(exit (run-test))"
diff --git a/src/engine/test/test-scm-query-import b/src/engine/test/test-scm-query-import.in
similarity index 81%
rename from src/engine/test/test-scm-query-import
rename to src/engine/test/test-scm-query-import.in
index 993f666..5094d76 100755
--- a/src/engine/test/test-scm-query-import
+++ b/src/engine/test/test-scm-query-import.in
@@ -1,2 +1,2 @@
-#!/bin/sh
-${GUILE} -l $SRCDIR/test-scm-query-import.scm -c "(exit (run-test))"
\ No newline at end of file
+#!@SHELL@
+${GUILE} -l $SRCDIR/test-scm-query-import.scm -c "(exit (run-test))"
diff --git a/src/gnc-module/test/test-gwrapped-c b/src/gnc-module/test/test-gwrapped-c.in
similarity index 98%
rename from src/gnc-module/test/test-gwrapped-c
rename to src/gnc-module/test/test-gwrapped-c.in
index 691106a..9c731cb 100755
--- a/src/gnc-module/test/test-gwrapped-c
+++ b/src/gnc-module/test/test-gwrapped-c.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 ${GUILE} -c "(use-modules (gnucash unittest-support))
           (define log-domain \"gnc.module\")
           (define check (new-TestErrorStruct))
diff --git a/src/gnc-module/test/test-load-deps b/src/gnc-module/test/test-load-deps.in
similarity index 98%
rename from src/gnc-module/test/test-load-deps
rename to src/gnc-module/test/test-load-deps.in
index 759322e..5d71951 100755
--- a/src/gnc-module/test/test-load-deps
+++ b/src/gnc-module/test/test-load-deps.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 exec ${GUILE} -s $0 "$@"
 !#
 ;; test-load-deps.scm : load gnc-mod-baz, which depends on gnc-mod-foo
diff --git a/src/gnc-module/test/test-load-scm b/src/gnc-module/test/test-load-scm.in
similarity index 98%
rename from src/gnc-module/test/test-load-scm
rename to src/gnc-module/test/test-load-scm.in
index 50a6812..a411892 100755
--- a/src/gnc-module/test/test-load-scm
+++ b/src/gnc-module/test/test-load-scm.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 exec ${GUILE} -s $0 "$@"
 !#
 
diff --git a/src/gnc-module/test/test-scm-dynload b/src/gnc-module/test/test-scm-dynload.in
similarity index 96%
rename from src/gnc-module/test/test-scm-dynload
rename to src/gnc-module/test/test-scm-dynload.in
index ac818bf..b5d6a41 100755
--- a/src/gnc-module/test/test-scm-dynload
+++ b/src/gnc-module/test/test-scm-dynload.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 echo "  test-scm-dynload: testing dynamic-link of libgnc-module from Scheme.";
 exec ${GUILE} -s $0 "$@"
 !#
diff --git a/src/gnc-module/test/test-scm-init b/src/gnc-module/test/test-scm-init.in
similarity index 98%
rename from src/gnc-module/test/test-scm-init
rename to src/gnc-module/test/test-scm-init.in
index 2723818..86d30dc 100755
--- a/src/gnc-module/test/test-scm-init
+++ b/src/gnc-module/test/test-scm-init.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 echo "  test-scm-init: testing Scheme-only module system init. ";
 exec ${GUILE} -s $0 "$@"
 !#
diff --git a/src/gnc-module/test/test-scm-module b/src/gnc-module/test/test-scm-module.in
similarity index 98%
rename from src/gnc-module/test/test-scm-module
rename to src/gnc-module/test/test-scm-module.in
index 1f62326..315621b 100755
--- a/src/gnc-module/test/test-scm-module
+++ b/src/gnc-module/test/test-scm-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 ${GUILE} -c "(use-modules (gnucash unittest-support))
           (define log-domain \"gnc.module\")
           (define check (new-TestErrorStruct))
diff --git a/src/gnc-module/test/test-scm-multi b/src/gnc-module/test/test-scm-multi.in
similarity index 98%
rename from src/gnc-module/test/test-scm-multi
rename to src/gnc-module/test/test-scm-multi.in
index 6d7ce49..1649116 100755
--- a/src/gnc-module/test/test-scm-multi
+++ b/src/gnc-module/test/test-scm-multi.in
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @SHELL@
 exec ${GUILE} -s $0 "$@"
 !#
 (use-modules (gnucash unittest-support))
diff --git a/src/gnome-utils/test/test-load-module b/src/gnome-utils/test/test-load-module.in
similarity index 96%
rename from src/gnome-utils/test/test-load-module
rename to src/gnome-utils/test/test-load-module.in
index 2bd23a7..6d214ac 100755
--- a/src/gnome-utils/test/test-load-module
+++ b/src/gnome-utils/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s $0
 !#
 
diff --git a/src/report/locale-specific/us/test/test-load-module b/src/report/locale-specific/us/test/test-load-module.in
similarity index 97%
rename from src/report/locale-specific/us/test/test-load-module
rename to src/report/locale-specific/us/test/test-load-module.in
index 1ff46a8..f78ce92 100755
--- a/src/report/locale-specific/us/test/test-load-module
+++ b/src/report/locale-specific/us/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s $0
 !#
 
diff --git a/src/report/report-gnome/test/test-load-module b/src/report/report-gnome/test/test-load-module.in
similarity index 97%
rename from src/report/report-gnome/test/test-load-module
rename to src/report/report-gnome/test/test-load-module.in
index 332bd29..054ada4 100755
--- a/src/report/report-gnome/test/test-load-module
+++ b/src/report/report-gnome/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s "$0"
 !#
 
diff --git a/src/report/report-system/test/test-load-module b/src/report/report-system/test/test-load-module.in
similarity index 97%
rename from src/report/report-system/test/test-load-module
rename to src/report/report-system/test/test-load-module.in
index c2bc75e..c4c3f42 100755
--- a/src/report/report-system/test/test-load-module
+++ b/src/report/report-system/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s "$0"
 !#
 
diff --git a/src/report/standard-reports/test/test-load-module b/src/report/standard-reports/test/test-load-module.in
similarity index 96%
rename from src/report/standard-reports/test/test-load-module
rename to src/report/standard-reports/test/test-load-module.in
index e4915f8..5f32565 100755
--- a/src/report/standard-reports/test/test-load-module
+++ b/src/report/standard-reports/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s "$0"
 !#
 
diff --git a/src/report/stylesheets/test/test-load-module b/src/report/stylesheets/test/test-load-module.in
similarity index 98%
rename from src/report/stylesheets/test/test-load-module
rename to src/report/stylesheets/test/test-load-module.in
index f1c3a13..8a58509 100755
--- a/src/report/stylesheets/test/test-load-module
+++ b/src/report/stylesheets/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s "$0"
 !#
 
diff --git a/src/report/utility-reports/test/test-load-module b/src/report/utility-reports/test/test-load-module.in
similarity index 96%
rename from src/report/utility-reports/test/test-load-module
rename to src/report/utility-reports/test/test-load-module.in
index 5bcaebb..1140b3b 100755
--- a/src/report/utility-reports/test/test-load-module
+++ b/src/report/utility-reports/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s "$0"
 !#
 
diff --git a/src/tax/us/test/test-load-module b/src/tax/us/test/test-load-module.in
similarity index 95%
rename from src/tax/us/test/test-load-module
rename to src/tax/us/test/test-load-module.in
index abf5294..86a8799 100755
--- a/src/tax/us/test/test-load-module
+++ b/src/tax/us/test/test-load-module.in
@@ -1,4 +1,4 @@
-#! /bin/sh 
+#! @SHELL@ 
 exec ${GUILE} -s "$0"
 !#
 

commit 9f3d6fc83c68ea702926440764f54082865bfc5d
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Dec 10 09:52:12 2015 -0800

    Bug 759224 - illegal dates in stock transactions cause corrupt file.
    
    Work around FreeBSD strptime bug.

diff --git a/src/backend/xml/sixtp-utils.c b/src/backend/xml/sixtp-utils.c
index 84474d8..f47d671 100644
--- a/src/backend/xml/sixtp-utils.c
+++ b/src/backend/xml/sixtp-utils.c
@@ -361,82 +361,14 @@ simple_chars_only_parser_new(sixtp_end_handler end_handler)
 gboolean
 string_to_timespec_secs(const gchar *str, Timespec *ts)
 {
-
-    struct tm parsed_time;
-    const gchar *strpos;
-    time64 parsed_secs;
-    long int gmtoff;
-
-    if (!str || !ts) return FALSE;
-
-    memset(&parsed_time, 0, sizeof(struct tm));
-
-    /* If you change this, make sure you also change the output code, if
-       necessary. */
-    /*fprintf(stderr, "parsing (%s)\n", str);*/
-    strpos = strptime(str, TIMESPEC_PARSE_TIME_FORMAT, &parsed_time);
-
-    g_return_val_if_fail(strpos, FALSE);
-
-    {
-        char sign;
-        int h1;
-        int h2;
-        int m1;
-        int m2;
-        int num_read;
-
-        /* must use "<" here because %n's effects aren't well defined */
-        if (sscanf(strpos, " %c%1d%1d%1d%1d%n",
-                   &sign,
-                   &h1,
-                   &h2,
-                   &m1,
-                   &m2,
-                   &num_read) < 5)
-        {
-            return(FALSE);
-        }
-
-        if ((sign != '+') && (sign != '-')) return(FALSE);
-        if (!isspace_str(strpos + num_read, -1)) return(FALSE);
-
-        gmtoff = (h1 * 10 + h2) * 60 * 60;
-        gmtoff += (m1 * 10 + m2) * 60;
-        if (sign == '-') gmtoff = - gmtoff;
-
-        parsed_time.tm_isdst = -1;
-    }
-
-    parsed_secs = gnc_timegm(&parsed_time);
-
-    parsed_secs -= gmtoff;
-
-    ts->tv_sec = parsed_secs;
-
+    *ts = gnc_iso8601_to_timespec_gmt(str);
     return(TRUE);
 }
 
 gboolean
 string_to_timespec_nsecs(const gchar *str, Timespec *ts)
 {
-    long int nanosecs;
-    unsigned int charcount;
-
-    if (!str || !ts) return FALSE;
-
-    /* The '%n' doesn't count as a conversion. */
-    if (1 != sscanf(str, " %ld%n", &nanosecs, &charcount))
-        return FALSE;
-
-    while ( (*((gchar*)str + charcount) != '\0') &&
-            isspace(*((unsigned char*)str + charcount)))
-        charcount++;
-
-    if (charcount != strlen(str)) return(FALSE);
-
-    ts->tv_nsec = nanosecs;
-
+    *ts = gnc_iso8601_to_timespec_gmt(str);
     return(TRUE);
 }
 



Summary of changes:
 configure.ac                                       | 43 ++++++++++++-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 src/backend/xml/sixtp-utils.c                      | 72 +---------------------
 .../{test-real-data.sh => test-real-data.sh.in}    |  2 +-
 src/bin/test/{test-version => test-version.in}     |  2 +-
 ...{test-create-account => test-create-account.in} |  2 +-
 ...t-scm-query-import => test-scm-query-import.in} |  4 +-
 .../test/{test-gwrapped-c => test-gwrapped-c.in}   |  2 +-
 .../test/{test-load-deps => test-load-deps.in}     |  2 +-
 .../test/{test-load-scm => test-load-scm.in}       |  2 +-
 .../test/{test-scm-dynload => test-scm-dynload.in} |  2 +-
 .../test/{test-scm-init => test-scm-init.in}       |  2 +-
 .../test/{test-scm-module => test-scm-module.in}   |  2 +-
 .../test/{test-scm-multi => test-scm-multi.in}     |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 .../test/{test-load-module => test-load-module.in} |  2 +-
 22 files changed, 65 insertions(+), 92 deletions(-)
 rename src/app-utils/test/{test-load-module => test-load-module.in} (99%)
 rename src/backend/xml/test/{test-real-data.sh => test-real-data.sh.in} (98%)
 rename src/bin/test/{test-version => test-version.in} (91%)
 rename src/engine/test/{test-create-account => test-create-account.in} (87%)
 rename src/engine/test/{test-scm-query-import => test-scm-query-import.in} (81%)
 rename src/gnc-module/test/{test-gwrapped-c => test-gwrapped-c.in} (98%)
 rename src/gnc-module/test/{test-load-deps => test-load-deps.in} (98%)
 rename src/gnc-module/test/{test-load-scm => test-load-scm.in} (98%)
 rename src/gnc-module/test/{test-scm-dynload => test-scm-dynload.in} (96%)
 rename src/gnc-module/test/{test-scm-init => test-scm-init.in} (98%)
 rename src/gnc-module/test/{test-scm-module => test-scm-module.in} (98%)
 rename src/gnc-module/test/{test-scm-multi => test-scm-multi.in} (98%)
 rename src/gnome-utils/test/{test-load-module => test-load-module.in} (96%)
 rename src/report/locale-specific/us/test/{test-load-module => test-load-module.in} (97%)
 rename src/report/report-gnome/test/{test-load-module => test-load-module.in} (97%)
 rename src/report/report-system/test/{test-load-module => test-load-module.in} (97%)
 rename src/report/standard-reports/test/{test-load-module => test-load-module.in} (96%)
 rename src/report/stylesheets/test/{test-load-module => test-load-module.in} (98%)
 rename src/report/utility-reports/test/{test-load-module => test-load-module.in} (96%)
 rename src/tax/us/test/{test-load-module => test-load-module.in} (95%)



More information about the gnucash-changes mailing list