Add versioned variants of some environment variables
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 4 Jul 2012 17:16:23 +0000 (18:16 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 4 Jul 2012 17:18:02 +0000 (18:18 +0100)
Improve parallel installability in setups like jhbuild by
providing versioned variants of some environment variables:

 GST_REGISTRY_1_0
 GST_PLUGIN_PATH_1_0
 GST_PLUGIN_SYSTEM_PATH_1_0
 GST_PLUGIN_SCANNER_1_0

will now be checked before checking the unversioned ones.

https://bugzilla.gnome.org/show_bug.cgi?id=679407

gst/gstpluginloader.c
gst/gstregistry.c

index a51fa89..4109192 100644 (file)
@@ -457,7 +457,9 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
 
   /* Find the gst-plugin-scanner: first try the env-var if it is set,
    * otherwise use the installed version */
-  env = g_getenv ("GST_PLUGIN_SCANNER");
+  env = g_getenv ("GST_PLUGIN_SCANNER_1_0");
+  if (env == NULL)
+    env = g_getenv ("GST_PLUGIN_SCANNER");
 
   if (env != NULL && *env != '\0') {
     GST_LOG ("Trying GST_PLUGIN_SCANNER env var: %s", env);
index c77cffe..109dbbd 100644 (file)
@@ -1121,7 +1121,8 @@ gst_registry_scan_plugin_file (GstRegistryScanContext * context,
             filename, file_size, file_mtime)) {
       g_warning ("External plugin loader failed. This most likely means that "
           "the plugin loader helper binary was not found or could not be run. "
-          "%s", (g_getenv ("GST_PLUGIN_PATH") != NULL) ?
+          "%s",
+          (g_getenv ("GST_PLUGIN_PATH") || g_getenv ("GST_PLUGIN_PATH_1_0")) ?
           "If you are running an uninstalled GStreamer setup, you might need "
           "to update your gst-uninstalled script so that the "
           "GST_PLUGIN_SCANNER environment variable gets set." : "");
@@ -1553,7 +1554,9 @@ scan_and_update_registry (GstRegistry * default_registry,
 
   /* GST_PLUGIN_PATH specifies a list of directories to scan for
    * additional plugins.  These take precedence over the system plugins */
-  plugin_path = g_getenv ("GST_PLUGIN_PATH");
+  plugin_path = g_getenv ("GST_PLUGIN_PATH_1_0");
+  if (plugin_path == NULL)
+    plugin_path = g_getenv ("GST_PLUGIN_PATH");
   if (plugin_path) {
     char **list;
     int i;
@@ -1571,7 +1574,9 @@ scan_and_update_registry (GstRegistry * default_registry,
   /* GST_PLUGIN_SYSTEM_PATH specifies a list of plugins that are always
    * loaded by default.  If not set, this defaults to the system-installed
    * path, and the plugins installed in the user's home directory */
-  plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
+  plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH_1_0");
+  if (plugin_path == NULL)
+    plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
   if (plugin_path == NULL) {
     char *home_plugins;
 
@@ -1661,7 +1666,10 @@ ensure_current_registry (GError ** error)
   gboolean have_cache = TRUE;
 
   default_registry = gst_registry_get ();
-  registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
+
+  registry_file = g_strdup (g_getenv ("GST_REGISTRY_1_0"));
+  if (registry_file == NULL)
+    registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
   if (registry_file == NULL) {
     registry_file = g_build_filename (g_get_user_cache_dir (),
         "gstreamer-" GST_API_VERSION, "registry." TARGET_CPU ".bin", NULL);