Bastian Blank
2009-Nov-22 11:08 UTC
[Pkg-xen-changes] r692 - in trunk/xen-common: debian scripts
Author: waldi Date: Sun Nov 22 11:08:30 2009 New Revision: 692 Log: * debian/xen-utils-common.xendomains.init, debian/xen-utils-common.xend.init, scripts/xen-utils-wrapper: Use xen-version. * scripts/xen-version: Move from scripts/xen-utils-version. * scripts/Makefile: Update. Added: trunk/xen-common/scripts/xen-version - copied unchanged from r686, trunk/xen-common/scripts/xen-utils-version Deleted: trunk/xen-common/scripts/xen-utils-version Modified: trunk/xen-common/debian/xen-utils-common.xend.init trunk/xen-common/debian/xen-utils-common.xendomains.init trunk/xen-common/scripts/Makefile trunk/xen-common/scripts/xen-utils-wrapper Modified: trunk/xen-common/debian/xen-utils-common.xend.init =============================================================================--- trunk/xen-common/debian/xen-utils-common.xend.init Sun Nov 22 11:06:53 2009 (r691) +++ trunk/xen-common/debian/xen-utils-common.xend.init Sun Nov 22 11:08:30 2009 (r692) @@ -12,7 +12,7 @@ PATH=/usr/lib/xen-common/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="Xen daemons" -VERSION=$(xen-utils-version) +VERSION=$(xen-version) ROOT=/usr/lib/xen-$VERSION XEND="$ROOT"/bin/xend Modified: trunk/xen-common/debian/xen-utils-common.xendomains.init =============================================================================--- trunk/xen-common/debian/xen-utils-common.xendomains.init Sun Nov 22 11:06:53 2009 (r691) +++ trunk/xen-common/debian/xen-utils-common.xendomains.init Sun Nov 22 11:08:30 2009 (r692) @@ -14,7 +14,7 @@ # Default-Enabled: yes PATH=/usr/lib/xen-common/bin:/sbin:/bin:/usr/sbin:/usr/bin -VERSION=$(xen-utils-version) +VERSION=$(xen-version) ROOT=/usr/lib/xen-$VERSION test "$VERSION" || exit 0 Modified: trunk/xen-common/scripts/Makefile =============================================================================--- trunk/xen-common/scripts/Makefile Sun Nov 22 11:06:53 2009 (r691) +++ trunk/xen-common/scripts/Makefile Sun Nov 22 11:08:30 2009 (r692) @@ -14,7 +14,7 @@ xm PRIVATE_SCRIPTS = \ - xen-utils-version \ + xen-version \ $(WRAPPER) WRAPPER = xen-utils-wrapper Modified: trunk/xen-common/scripts/xen-utils-wrapper =============================================================================--- trunk/xen-common/scripts/xen-utils-wrapper Sun Nov 22 11:06:53 2009 (r691) +++ trunk/xen-common/scripts/xen-utils-wrapper Sun Nov 22 11:08:30 2009 (r692) @@ -3,7 +3,7 @@ set -e COMMAND="$(basename $0)" -VERSION=$(/usr/lib/xen-common/bin/xen-utils-version -v) +VERSION=$(/usr/lib/xen-common/bin/xen-version -v) if [ -z "$VERSION" ]; then VERSION="default" Copied: trunk/xen-common/scripts/xen-version (from r686, trunk/xen-common/scripts/xen-utils-version) =============================================================================--- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/xen-common/scripts/xen-version Sun Nov 22 11:08:30 2009 (r692, copy of r686, trunk/xen-common/scripts/xen-utils-version) @@ -0,0 +1,28 @@ +#!/bin/bash + +while getopts "v" OPT; do + case "$OPT" in + v) + VERBOSE=1 + ;; + esac +done + +if [ -e "/sys/hypervisor/type" ]; then + if [ "$(cat /sys/hypervisor/type)" = xen ]; then + DIR=/sys/hypervisor/version + VERSION_EXTRA=$(cat $DIR/extra) + if [ "$VERSION_EXTRA" = "-unstable" ]; then + VERSION=unstable + else + VERSION="$(cat $DIR/major).$(cat $DIR/minor)$VERSION_EXTRA" + fi + else + [ "$VERBOSE" ] && echo "WARING! Can''t read type from sysfs!" >&2 + fi +else + [ "$VERBOSE" ] && echo "WARING! Can''t find hypervisor information in sysfs!" >&2 +fi + +echo "$VERSION" +exit 0