r19651 - gnucash/trunk/src - Make sure the right gnc-fq-* scripts are used.

Geert Janssens gjanssens at code.gnucash.org
Wed Oct 13 12:11:44 EDT 2010


Author: gjanssens
Date: 2010-10-13 12:11:44 -0400 (Wed, 13 Oct 2010)
New Revision: 19651
Trac: http://svn.gnucash.org/trac/changeset/19651

Modified:
   gnucash/trunk/src/core-utils/core-utils.i
   gnucash/trunk/src/core-utils/core-utils.scm
   gnucash/trunk/src/core-utils/gnc-path.c
   gnucash/trunk/src/core-utils/gnc-path.h
   gnucash/trunk/src/core-utils/gncla-dir.h.in
   gnucash/trunk/src/scm/price-quotes.scm
Log:
Make sure the right gnc-fq-* scripts are used.

With the original configuration, whatever script was found first on the path was used.
When testing development versions, this caused the also installed stable version to 
be used as it happened to appear first on the path.

Modified: gnucash/trunk/src/core-utils/core-utils.i
===================================================================
--- gnucash/trunk/src/core-utils/core-utils.i	2010-10-12 18:24:26 UTC (rev 19650)
+++ gnucash/trunk/src/core-utils/core-utils.i	2010-10-13 16:11:44 UTC (rev 19651)
@@ -12,11 +12,9 @@
 
 %import "base-typemaps.i"
 
-%newobject g_find_program_in_path;
-gchar * g_find_program_in_path(const gchar *);
-
 gboolean gnc_is_debugging(void);
 
+gchar * gnc_path_get_bindir(void);
 gchar * gnc_path_get_stdreportsdir(void);
 gchar * gnc_build_dotgnucash_path(const gchar *);
 gchar * gnc_build_report_path(const gchar *);

Modified: gnucash/trunk/src/core-utils/core-utils.scm
===================================================================
--- gnucash/trunk/src/core-utils/core-utils.scm	2010-10-12 18:24:26 UTC (rev 19650)
+++ gnucash/trunk/src/core-utils/core-utils.scm	2010-10-13 16:11:44 UTC (rev 19651)
@@ -10,11 +10,11 @@
 (use-modules (sw_core_utils))
 
 (re-export gnc-is-debugging)
+(re-export gnc-path-get-bindir)
 (re-export gnc-path-get-stdreportsdir)
 (re-export gnc-build-dotgnucash-path)
 (re-export gnc-build-report-path)
 (re-export gnc-build-stdreports-path)
-(re-export g-find-program-in-path)
 (re-export gnc-utf8?)
 (re-export gnc-utf8-strip-invalid-strdup)
 (re-export gnc-locale-from-utf8)

Modified: gnucash/trunk/src/core-utils/gnc-path.c
===================================================================
--- gnucash/trunk/src/core-utils/gnc-path.c	2010-10-12 18:24:26 UTC (rev 19650)
+++ gnucash/trunk/src/core-utils/gnc-path.c	2010-10-13 16:11:44 UTC (rev 19651)
@@ -31,6 +31,16 @@
     return gnc_gbr_find_prefix (PREFIX);
 }
 
+/** Returns the bindir path, usually
+ * "$prefix/bin".
+ *
+ * @returns A newly allocated string. */
+gchar *gnc_path_get_bindir()
+{
+    //printf("Returning bindir %s\n", gnc_gbr_find_bin_dir (BINDIR));
+    return gnc_gbr_find_bin_dir (BINDIR);
+}
+
 /** Returns the libdir path, usually
  * "$prefix/lib". Needed for gnome_program_init().
  *

Modified: gnucash/trunk/src/core-utils/gnc-path.h
===================================================================
--- gnucash/trunk/src/core-utils/gnc-path.h	2010-10-12 18:24:26 UTC (rev 19650)
+++ gnucash/trunk/src/core-utils/gnc-path.h	2010-10-13 16:11:44 UTC (rev 19651)
@@ -31,6 +31,12 @@
  * @returns A newly allocated string. */
 gchar *gnc_path_get_prefix(void);
 
+/** Returns the bindir path, usually
+ * "$prefix/bin".
+ *
+ * @returns A newly allocated string. */
+gchar *gnc_path_get_bindir(void);
+
 /** Returns the libdir path, usually
  * "$prefix/lib". Needed for gnome_program_init(void).
  *

Modified: gnucash/trunk/src/core-utils/gncla-dir.h.in
===================================================================
--- gnucash/trunk/src/core-utils/gncla-dir.h.in	2010-10-12 18:24:26 UTC (rev 19650)
+++ gnucash/trunk/src/core-utils/gncla-dir.h.in	2010-10-13 16:11:44 UTC (rev 19651)
@@ -27,6 +27,7 @@
 #define DATADIR "@-datadir-@"
 #define SYSCONFDIR "@-sysconfdir-@"
 
+#define BINDIR "@-bindir-@"
 #define LIBDIR "@-libdir-@"
 
 #define LOCALE_DATADIRNAME "@-DATADIRNAME-@"

Modified: gnucash/trunk/src/scm/price-quotes.scm
===================================================================
--- gnucash/trunk/src/scm/price-quotes.scm	2010-10-12 18:24:26 UTC (rev 19650)
+++ gnucash/trunk/src/scm/price-quotes.scm	2010-10-13 16:11:44 UTC (rev 19651)
@@ -240,7 +240,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define gnc:*finance-quote-check*
-  (g-find-program-in-path "gnc-fq-check"))
+  (string-append (gnc-path-get-bindir) "/gnc-fq-check"))
 
 (define (gnc:fq-check-sources)
   (let ((program '())
@@ -286,7 +286,7 @@
 ;; src/engine/gnc-pricedb.h
 
 (define gnc:*finance-quote-helper*
-  (g-find-program-in-path "gnc-fq-helper"))
+  (string-append (gnc-path-get-bindir) "/gnc-fq-helper"))
 
 (define (gnc:fq-get-quotes requests)
   ;; requests should be a list where each item is of the form



More information about the gnucash-changes mailing list