diff options
author | Bastien Nocera <hadess@hadess.net> | 2020-08-20 17:00:05 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2020-08-20 17:00:05 +0200 |
commit | fda52e8ed09f8f7df2247ae5f7a8409dba1b38df (patch) | |
tree | bbbb18cf012e4dca39a779e006465fd7d75bf3e0 | |
parent | f3f1b5fbd797c30093820d8fc81996c79a179910 (diff) | |
download | totem-pl-parser-fda52e8ed09f8f7df2247ae5f7a8409dba1b38df.tar.gz |
videosite: Use envvar to change the videoscript dirwip/hadess/script-dir
Use TOTEM_PL_PARSER_VIDEOSITE_SCRIPT_DIR to override the default
directory to find videosite scripts in.
-rw-r--r-- | plparse/totem-pl-parser-videosite.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c index 456789e..13ffe17 100644 --- a/plparse/totem-pl-parser-videosite.c +++ b/plparse/totem-pl-parser-videosite.c @@ -69,13 +69,17 @@ static char * find_helper_script (void) { GDir *dir; - const char *name; + const char *name, *script_dir; char *script_name = NULL; if (g_getenv (SCRIPT_ENVVAR) != NULL) return g_strdup (g_getenv (SCRIPT_ENVVAR)); - dir = g_dir_open (LIBEXECDIR "/totem-pl-parser", 0, NULL); + script_dir = g_getenv ("TOTEM_PL_PARSER_VIDEOSITE_SCRIPT_DIR"); + if (!script_dir) + script_dir = LIBEXECDIR "/totem-pl-parser"; + + dir = g_dir_open (script_dir, 0, NULL); if (!dir) goto bail; @@ -92,7 +96,7 @@ find_helper_script (void) if (script_name != NULL) { char *ret; - ret = g_build_filename (LIBEXECDIR "/totem-pl-parser", script_name, NULL); + ret = g_build_filename (script_dir, script_name, NULL); g_free (script_name); return ret; } |