Blame SOURCES/bltk-1.0.9-rpm.patch

16f2df
diff -up bltk/tools/analyzer/bltk_get_hd_rpm.sh.rpm bltk/tools/analyzer/bltk_get_hd_rpm.sh
16f2df
--- bltk/tools/analyzer/bltk_get_hd_rpm.sh.rpm	2010-01-07 19:21:38.000000000 +0100
16f2df
+++ bltk/tools/analyzer/bltk_get_hd_rpm.sh	2010-10-25 09:27:38.070983166 +0200
16f2df
@@ -46,25 +46,29 @@ model="$*"
16f2df
 
16f2df
 set_bltk_root()
16f2df
 {
16f2df
-	PROG=`basename $0`
16f2df
+  BLTK_BIN=`which bltk 2> /dev/null`
16f2df
+  RETCODE=$?
16f2df
 
16f2df
-	BLTK_ROOT=`dirname $0`
16f2df
-	if [[ ! -a $BLTK_ROOT/.bltk ]]
16f2df
-	then
16f2df
-		BLTK_ROOT=`dirname $BLTK_ROOT`
16f2df
-		if [[ ! -a $BLTK_ROOT/.bltk ]]
16f2df
-		then
16f2df
-			echo "Cannot determine bltk root, bltk tree corrupted."
16f2df
-			exit 2
16f2df
-		fi
16f2df
-	fi
16f2df
-	export BLTK_ROOT
16f2df
-	export BLTK_BIN=$BLTK_ROOT/bin
16f2df
-	export BLTK_TMP=$BLTK_ROOT/tmp
16f2df
+  if [[ $RETCODE = 0 ]]
16f2df
+  then
16f2df
+    if [[ -L $BLTK_BIN ]]
16f2df
+    then
16f2df
+      BLTK_BIN=`readlink -f $BLTK_BIN`
16f2df
+    fi
16f2df
+    BLTK_ROOT=${BLTK_BIN%/bin/*}
16f2df
+    export BLTK_ROOT
16f2df
+  fi
16f2df
+
16f2df
+  return $RETCODE
16f2df
 }
16f2df
 
16f2df
 set_bltk_root
16f2df
 
16f2df
+if [[ $? -ne 0 ]]; then 
16f2df
+  echo "Cannot determine bltk root, bltk tree corrupted."
16f2df
+  exit 2
16f2df
+fi
16f2df
+
16f2df
 RPM_FILE=$BLTK_ROOT/data/hd_rpm.data
16f2df
 
16f2df
 MODEL=