From 6188192e4ede1992804382834f3d86f7666480d4 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sat, 7 Jul 2012 01:41:28 +0000 Subject: [PATCH] 1. no more strip/unstrip of path/ld_library_paht - i think we no longer need or want it. 2. prepend e's bin dir to PATH and lib dir to LD_LIBRARY_PATH for better "it just works" usability. :) SVN revision: 73430 --- src/bin/e_main.c | 28 ++++++++++++++++++++++++++++ src/bin/e_utils.c | 8 ++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/bin/e_main.c b/src/bin/e_main.c index cbb5770e9..1fda448ca 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -140,6 +140,31 @@ _xdg_data_dirs_augment(void) } } +static void +_env_path_prepend(const char *env, const char *path) +{ + char *p, *p2, *s; + int len = 0, len2 = 0; + + p = getenv(env); + if (p) len = strlen(p); + p2 = (char *)path; + if (p2) len2 = strlen(p2); + s = malloc(len + 1 + len2 + 1); + if (s) + { + s[0] = 0; + if (p) strcat(s, p); + if (p2) + { + strcat(s, ":"); + strcat(s, p2); + } + e_util_env_set(env, s); + free(s); + } +} + static void _fix_user_default_edj(void) { @@ -245,6 +270,9 @@ main(int argc, char **argv) } TS("Determine Prefix Done"); + _env_path_prepend("PATH", e_prefix_bin_get()); + _env_path_prepend("LD_LIBRARY_PATH", e_prefix_lib_get()); + /* for debugging by redirecting stdout of e to a log file to tail */ setvbuf(stdout, NULL, _IONBF, 0); diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 9c9822266..41ddff44f 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -936,12 +936,13 @@ e_util_file_time_get(time_t ftime) return s; } -static char *prev_ld_library_path = NULL; -static char *prev_path = NULL; +//static char *prev_ld_library_path = NULL; +//static char *prev_path = NULL; EAPI void e_util_library_path_strip(void) { +/* disabled as i think we dont need/want this anymore - leftover from a bygone era char *p, *p2; p = getenv("LD_LIBRARY_PATH"); @@ -962,11 +963,13 @@ e_util_library_path_strip(void) if (p2) p2++; e_util_env_set("PATH", p2); } + */ } EAPI void e_util_library_path_restore(void) { +/* disabled as i think we dont need/want this anymore - leftover from a bygone era if (prev_ld_library_path) { e_util_env_set("LD_LIBRARY_PATH", prev_ld_library_path); @@ -977,6 +980,7 @@ e_util_library_path_restore(void) e_util_env_set("PATH", prev_path); E_FREE(prev_path); } + */ } EAPI Evas_Object *