Bastian Blank
2006-Aug-23 11:40 UTC
[Pkg-xen-changes] r275 - in trunk/xen-unstable/debian: . bin
Author: waldi Date: Wed Aug 23 11:39:50 2006 New Revision: 275 Added: trunk/xen-unstable/debian/templates/xen-utils.postinst.in trunk/xen-unstable/debian/templates/xen-utils.prerm.in Modified: trunk/xen-unstable/debian/bin/gencontrol.py trunk/xen-unstable/debian/rules.real Log: * debian/bin/gencontrol.py - Export complete extraversion. - Install postinst and prerm scripts. * debian/templates/xen-utils.postinst.in, debian/templates/xen-utils.prerm.in: Add. Modified: trunk/xen-unstable/debian/bin/gencontrol.py =============================================================================--- trunk/xen-unstable/debian/bin/gencontrol.py (original) +++ trunk/xen-unstable/debian/bin/gencontrol.py Wed Aug 23 11:39:50 2006 @@ -17,6 +17,7 @@ ''MAJOR'': self.version[''xen''][''major''], ''VERSION'': self.version[''xen''][''version''], ''SHORT_VERSION'': self.version[''xen''][''short_version''], + ''EXTRAVERSION'': self.version[''xen''][''extraversion''], ''ABINAME'': self.abiname, }) @@ -47,6 +48,10 @@ package_utils_name = packages_utils[0][''Package''] + for i in (''postinst'', ''prerm''): + j = self.substitute(self.templates["xen-utils.%s" % i], vars) + file("debian/%s.%s" % (package_utils_name, i), ''w'').write(j) + cmds_binary_arch = [] cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-arch %s" % makeflags)) cmds_build = [] @@ -120,8 +125,10 @@ (?P<version> (?P<major>\d+\.\d+) ( - (?P<minor>\.\d+) - -\d+ + (?P<extraversion> + (?P<minor>\.\d+) + -\d+ + ) | (?P<unstable>-unstable) ) @@ -145,9 +152,11 @@ if ret[''unstable''] is not None: ret[''major''] = ''unstable'' ret[''short_version''] = ret[''version''] + ret[''extraversion''] = ret[''unstable''] else: ret[''version''] = ret[''major''] + ret[''minor''] ret[''short_version''] = ret[''major''] + del ret[''unstable''] return ret if __name__ == ''__main__'': Modified: trunk/xen-unstable/debian/rules.real =============================================================================--- trunk/xen-unstable/debian/rules.real (original) +++ trunk/xen-unstable/debian/rules.real Wed Aug 23 11:39:50 2006 @@ -33,6 +33,7 @@ $(STAMPS_DIR)/setup-hypervisor_$(ARCH)_$(FLAVOUR): $(STAMPS_DIR)/source @rm -rf $(DIR) cp -a $(SOURCE_DIR) $(DIR) + echo "XEN_EXTRAVERSION := $(EXTRAVERSION)$(ABINAME)" > $(DIR)/xen/xen-version touch $@ $(STAMPS_DIR)/setup-utils_$(ARCH): SOURCE_DIR=$(BUILD_DIR)/source Added: trunk/xen-unstable/debian/templates/xen-utils.postinst.in =============================================================================--- (empty file) +++ trunk/xen-unstable/debian/templates/xen-utils.postinst.in Wed Aug 23 11:39:50 2006 @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + update-alternatives --install /usr/lib/xen-default xen-default /usr/lib/xen-@version@@abiname@ 1 || true + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1''" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 Added: trunk/xen-unstable/debian/templates/xen-utils.prerm.in =============================================================================--- (empty file) +++ trunk/xen-unstable/debian/templates/xen-utils.prerm.in Wed Aug 23 11:39:50 2006 @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +case "$1" in + remove) + update-alternatives --remove xen-default /usr/lib/xen-@version@@abiname@ + ;; + + upgrade|deconfigure|failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1''" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0