gst-uninstalled: Allow specifying the checkout directory by env variable
authorEdward Hervey <bilboed@bilboed.com>
Sun, 22 Sep 2013 09:09:36 +0000 (11:09 +0200)
committerEdward Hervey <edward@collabora.com>
Sun, 22 Sep 2013 13:44:55 +0000 (15:44 +0200)
For some rare cases, one might not be able to use the hardcoded $HOME/gst
location yet would still want to use the gst-uninstalled script as-is (which
has the benefit of being constantly updated).

For these cases, the checkout directory can be specified with the
GST_UNINSTALLED_ROOT environment variable.

Ex:
export GST_UNINSTALLED_ROOT=$HOME/somewhere/with/checkouts

And then just call gst-uninstalled directly:
$GST_UNINSTALLED_ROOT/gstreamer/gst-uninstalled

scripts/gst-uninstalled

index dd1ffa9..633dff8 100755 (executable)
 
 # This script is run -i so that PS1 doesn't get cleared
 
-# Change this variable to the location of your gstreamer git checkouts
-MYGST=$HOME/gst
-
-#
-# Everything below this line shouldn't be edited!
-#
-
-# extract version from $0
-# if this script is called "gst-head" then version will be "head"
-VERSION=`echo $0 | sed s/.*gst-//g`
+if [ -z $GST_UNINSTALLED_ROOT ];
+then
+    # Change this variable to the location of your gstreamer git checkouts
+    MYGST=$HOME/gst
+
+    #
+    # Everything below this line shouldn't be edited!
+    #
+
+    # extract version from $0
+    # if this script is called "gst-head" then version will be "head"
+    VERSION=`echo $0 | sed s/.*gst-//g`
+
+    # base path under which dirs are installed
+    GST=$MYGST/$VERSION
+else
+    # Alternatively, you can set the GST_UNINSTALLED_ROOT environment variable to the
+    # location of your checkout and call this script directly.
+    #
+    # Ex: GST_UNINSTALLED_ROOT=$HOME/checkout/location gst-uninstalled
+
+    GST=$GST_UNINSTALLED_ROOT
+fi
 
-# base path under which dirs are installed
-GST=$MYGST/$VERSION
 GST_PREFIX=$GST/prefix
 if test ! -e $GST; then
   echo "$GST does not exist !"