]> sourceware.org Git - systemtap.git/commitdiff
Add check for '.sh' suffix on byteman specific commands
authorLukas Berk <lberk@redhat.com>
Mon, 29 Apr 2013 14:47:58 +0000 (10:47 -0400)
committerLukas Berk <lberk@redhat.com>
Wed, 1 May 2013 15:13:37 +0000 (11:13 -0400)
*java/stapbm: When installed from rpm, byteman scripts do not have the
      '.sh' suffix.  However, they do if byteman is installed from
      source.  We need to be flexible on which we accept.

java/stapbm

index 01b7d92e9d28e0ade9e6b288eb8414536803cc53..adbb04c34bfa76a540f1d6c4c4733f99d0e9b6c1 100755 (executable)
 # $8 - entry/exit/line
 # $9 - options to pass to bminstall
 
+#byteman scripts may be named either with a '.sh' suffix or not
+if which bminstall &>/dev/null; then
+BMINSTALL=`which bminstall`
+else
+BMINSTALL=`which bminstall.sh`
+fi
+
+if which bmsubmit &>/dev/null; then
+BMSUBMIT=`which bmsubmit`
+else
+BMSUBMIT=`which bmsubmit.sh`
+fi
+
 #We need to both record, and check that this pid is the first
 #This is to avoid recurssion in probing java processes
 FILE=`hostname`-$$
@@ -62,7 +75,7 @@ function install_byteman()
     then
        touch $4/java/$JAVA_FILE
        touch $4/java/`hostname`-install
-       exec bminstall.sh $5 $2 &
+       exec $BMINSTALL $5 $2 &
        pid=$!
        wait $pid
        rm $4/java/`hostname`-install 2>&1 1>/dev/null
@@ -74,7 +87,7 @@ function submit_byteman()
     if [[ -f $4/java/$JAVA_FILE && ! -f $4/java/`hostname`-submit && ! -f $4/java/`hostname`-install ]]
     then
        touch $4/java/`hostname`-submit
-       exec bmsubmit.sh -l $4/java/$3.btm 2>&1 1>/dev/null &
+       exec $BMSUBMIT -l $4/java/$3.btm 2>&1 1>/dev/null &
        pida=$!
        wait $pida
        rm $4/java/`hostname`-submit 2>/dev/null 1>/dev/null
This page took 0.198781 seconds and 5 git commands to generate.