Bastian Blank
2011-Oct-26 22:53 UTC
[Pkg-xen-changes] r930 - trunk/xen-common/debian/scripts
Author: waldi Date: Wed Oct 26 22:53:55 2011 New Revision: 930 Log: debian/scripts/xen-toolstack: Make detection more stable. Modified: trunk/xen-common/debian/scripts/xen-toolstack Modified: trunk/xen-common/debian/scripts/xen-toolstack =============================================================================--- trunk/xen-common/debian/scripts/xen-toolstack Wed Oct 26 22:40:50 2011 (r929) +++ trunk/xen-common/debian/scripts/xen-toolstack Wed Oct 26 22:53:55 2011 (r930) @@ -4,14 +4,20 @@ dir=$(. /usr/lib/xen-common/bin/xen-dir); ret=$?; [ $ret -eq 0 ] || exit $ret -export PATH="$dir:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +check() { + if [ "$1" = xm ] || [ "$1" = xl ]; then + PATH="$dir/bin" command -v "$1" + else + PATH="$dir/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" command -v "$1" + fi +} if [ -e $configfile ]; then . $configfile || true fi if [ "$TOOLSTACK" ]; then - cmd=$(command -v "$TOOLSTACK") + cmd=$(check "$TOOLSTACK") if [ "$cmd" ]; then echo "$cmd" else @@ -21,8 +27,8 @@ fi if [ -z "$TOOLSTACK" ]; then - cmd_xm=$(command -v xm) - cmd_xl=$(command -v xl) + cmd_xm=$(check xm) + cmd_xl=$(check xl) if [ "$cmd_xm" ]; then echo "$cmd_xm" elif [ "$cmd_xl" ]; then