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