From de7b16533ea19569228d7236880d8d36d6acaa70 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 13 Oct 2010 16:11:44 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19651 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/core-utils/core-utils.i | 4 +--- src/core-utils/core-utils.scm | 2 +- src/core-utils/gnc-path.c | 10 ++++++++++ src/core-utils/gnc-path.h | 6 ++++++ src/core-utils/gncla-dir.h.in | 1 + src/scm/price-quotes.scm | 4 ++-- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/core-utils/core-utils.i b/src/core-utils/core-utils.i index ca6fca60f4..07f2e72edf 100644 --- a/src/core-utils/core-utils.i +++ b/src/core-utils/core-utils.i @@ -12,11 +12,9 @@ SCM scm_init_sw_core_utils_module (void); %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 *); diff --git a/src/core-utils/core-utils.scm b/src/core-utils/core-utils.scm index 53ea7a5d61..0b8ad1eb25 100644 --- a/src/core-utils/core-utils.scm +++ b/src/core-utils/core-utils.scm @@ -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) diff --git a/src/core-utils/gnc-path.c b/src/core-utils/gnc-path.c index 1503b27afa..39acbbdc5f 100644 --- a/src/core-utils/gnc-path.c +++ b/src/core-utils/gnc-path.c @@ -31,6 +31,16 @@ gchar *gnc_path_get_prefix() 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(). * diff --git a/src/core-utils/gnc-path.h b/src/core-utils/gnc-path.h index 8d899d407e..47505b5cf8 100644 --- a/src/core-utils/gnc-path.h +++ b/src/core-utils/gnc-path.h @@ -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). * diff --git a/src/core-utils/gncla-dir.h.in b/src/core-utils/gncla-dir.h.in index 3802c96dbf..c6921787e6 100644 --- a/src/core-utils/gncla-dir.h.in +++ b/src/core-utils/gncla-dir.h.in @@ -27,6 +27,7 @@ #define DATADIR "@-datadir-@" #define SYSCONFDIR "@-sysconfdir-@" +#define BINDIR "@-bindir-@" #define LIBDIR "@-libdir-@" #define LOCALE_DATADIRNAME "@-DATADIRNAME-@" diff --git a/src/scm/price-quotes.scm b/src/scm/price-quotes.scm index 537f1fa579..9d30bc9af7 100644 --- a/src/scm/price-quotes.scm +++ b/src/scm/price-quotes.scm @@ -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