Bastian Blank
2011-Oct-26 20:45 UTC
[Pkg-xen-changes] r923 - trunk/xen-common/debian/scripts
Author: waldi Date: Wed Oct 26 20:45:16 2011 New Revision: 923 Log: * debian/scripts/Makefile: Install xen-dir. * debian/scripts/xen-dir: Add. Added: trunk/xen-common/debian/scripts/xen-dir (contents, props changed) Modified: trunk/xen-common/debian/scripts/Makefile Modified: trunk/xen-common/debian/scripts/Makefile =============================================================================--- trunk/xen-common/debian/scripts/Makefile Wed Oct 26 20:40:29 2011 (r922) +++ trunk/xen-common/debian/scripts/Makefile Wed Oct 26 20:45:16 2011 (r923) @@ -22,6 +22,7 @@ GLOBAL_UTILS_WRAPPER = xen-utils-wrapper PRIVATE_SCRIPTS = \ + xen-dir \ xen-version \ $(GLOBAL_UTILS_WRAPPER) Added: trunk/xen-common/debian/scripts/xen-dir =============================================================================--- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/xen-common/debian/scripts/xen-dir Wed Oct 26 20:45:16 2011 (r923) @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +VERSION=$($(dirname $0)/xen-version -v) + +if [ -d "/usr/lib/xen-$VERSION" ]; then + echo "/usr/lib/xen-$VERSION" +elif [ -d "/usr/lib/xen-default" ]; then + echo "WARING: Can''t find version $VERSION of xen utils, fallback to default version!" >&2 + echo "/usr/lib/xen-default" +else + echo "ERROR: Can''t find default version of xen utils, bailing out!" >&2 + exit 127 +fi