Blame SOURCES/bltk-1.0.9-rpm.patch

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