[farsight2/master] Add uninstalled-paths.sh script

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:25:16 PST 2008


---
 uninstalled-paths.sh |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100755 uninstalled-paths.sh

diff --git a/uninstalled-paths.sh b/uninstalled-paths.sh
new file mode 100755
index 0000000..5c56337
--- /dev/null
+++ b/uninstalled-paths.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Generate environment for using Farsight 2 from Git checkout.
+
+realpath_ ()
+{
+    ( cd $0 2>/dev/null; pwd )
+}
+
+pjoin ()
+{
+    a=$(realpath_ $1)
+    b="$2"
+
+    [ -z "$a" ] && { echo $b ; return ; }
+
+    if [ -z "$b" ]; then
+        # Existing path list is empty.
+        echo "$a"
+    elif ! echo "$b" | sed -e 's/:/\\n/g' | grep -q "^$a$"; then
+        # New path is not in path list.
+        echo "$a:$b"
+    else
+        # New path is already in path list.
+        echo "$b"
+    fi
+}
+
+p=$(realpath_ $(dirname $0))
+ppath="$FS_PLUGIN_PATH"
+
+echo export PYTHONPATH=`pjoin "$p/python/.libs" "$PYTHONPATH"`
+echo export GST_PLUGIN_PATH=`pjoin "$p/gst" "$GST_PLUGIN_PATH"`
+
+for i in `find $p/transmitters -maxdepth 1 -type d -exec basename '{}' ';'`; do
+    ppath=`pjoin "$p/transmitters/$i/.libs" "$ppath"`
+done
+
+echo "export FS_PLUGIN_PATH=$ppath"
-- 
1.5.6.5




More information about the farsight-commits mailing list