Bastian Blank
2007-Aug-02 10:08 UTC
[Pkg-xen-changes] r409 - in trunk/xen-3/debian: . bin lib lib/python lib/python/debian_xen templates
Author: waldi Date: Thu Aug 2 10:08:29 2007 New Revision: 409 Log: * debian/bin/gencontrol.py: Update. * debian/changelog: Update version. * debian/rules: Fix gencontrol invocation. * debian/rules.defs: Use kernel 2.6.22-1. * debian/rules.real, debian/templates/control.hypervisor.in, debian/templates/control.main.in, debian/templates/control.utils.in: Update xen-docs name. * debian/lib, debian/lib/python, debian/lib/python/debian_xen: New directory. * debian/lib/python/debian_xen/__init__.py: Search linux-support ourself. * debian/lib/python/debian_xen/debian.py - Add version code. - Shorten version parts by one item. - Drop support for unstable versioning. Added: trunk/xen-3/debian/lib/ trunk/xen-3/debian/lib/python/ trunk/xen-3/debian/lib/python/debian_xen/ trunk/xen-3/debian/lib/python/debian_xen/__init__.py trunk/xen-3/debian/lib/python/debian_xen/debian.py Modified: trunk/xen-3/debian/bin/gencontrol.py trunk/xen-3/debian/changelog trunk/xen-3/debian/rules trunk/xen-3/debian/rules.defs trunk/xen-3/debian/rules.real trunk/xen-3/debian/templates/control.hypervisor.in trunk/xen-3/debian/templates/control.main.in trunk/xen-3/debian/templates/control.utils.in Modified: trunk/xen-3/debian/bin/gencontrol.py =============================================================================--- trunk/xen-3/debian/bin/gencontrol.py (original) +++ trunk/xen-3/debian/bin/gencontrol.py Thu Aug 2 10:08:29 2007 @@ -1,23 +1,22 @@ #!/usr/bin/env python2.4 -import sys -sys.path.append(sys.argv[2]+ "/lib/python") -import debian_linux.gencontrol +import os, sys +sys.path.append(os.path.join(sys.path[0], "../lib/python")) +from debian_xen.debian import VersionXen +from debian_linux.gencontrol import Gencontrol as Base from debian_linux.config import * from debian_linux.debian import * -class gencontrol(debian_linux.gencontrol.gencontrol): +class Gencontrol(Base): makefile_targets = (''binary-arch'', ''build'', ''setup'') def __init__(self): - super(gencontrol, self).__init__() - self.process_changelog(read_changelog()) + super(Gencontrol, self).__init__() + self.process_changelog() def do_main_setup(self, vars, makeflags, extra): makeflags.update({ - ''MAJOR'': self.version[''xen''][''major''], - ''VERSION'': self.version[''xen''][''version''], - ''SHORT_VERSION'': self.version[''xen''][''short_version''], - ''EXTRAVERSION'': self.version[''xen''][''extraversion''], + ''MAJOR'': self.version.xen_major, + ''VERSION'': self.version.xen_version, ''ABINAME'': self.abiname, }) @@ -110,63 +109,15 @@ makefile.append(("setup-%s-%s-real:" % (arch, flavour), cmds_setup)) makefile.append(("source-%s-%s-real:" % (arch, flavour))) - def process_changelog(self, changelog): - self.version = changelog[0][''Version''] - self.version[''xen''] = parse_version_xen(self.version[''complete'']) + def process_changelog(self): + changelog = Changelog(version = VersionXen) + self.version = changelog[0].version self.abiname = ''-%s'' % self.config[''abi'',][''abiname''] self.vars = { - ''major'': self.version[''xen''][''major''], - ''version'': self.version[''xen''][''version''], - ''short_version'': self.version[''xen''][''short_version''], + ''major'': self.version.xen_major, + ''version'': self.version.xen_version, ''abiname'': self.abiname, } -def parse_version_xen(version): - version_re = ur""" -^ -(?P<source> - (?P<upstream> - (?P<version> - (?P<major>\d+\.\d+) - ( - ( - (?P<minor>\.\d+) - ( - (-\d+) - | - (~rc\d+) - ) - ) - | - (?P<unstable>-unstable) - ) - ) - (?: - \+hg - (?P<hg_rev> - \d+ - ) - )? - ) - - - (?P<debian>[^-]+) -) -$ -""" - match = re.match(version_re, version, re.X) - if match is None: - raise ValueError - ret = match.groupdict() - 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''] - ret[''extraversion''] = ret[''minor''] - del ret[''unstable''] - return ret - if __name__ == ''__main__'': - gencontrol()() + Gencontrol()() Modified: trunk/xen-3/debian/changelog =============================================================================--- trunk/xen-3/debian/changelog (original) +++ trunk/xen-3/debian/changelog Thu Aug 2 10:08:29 2007 @@ -1,4 +1,4 @@ -xen-3 (3.1.0-0-1) UNRELEASED; urgency=low +xen-3 (3.1.0-1) UNRELEASED; urgency=low [ Julien Danjou ] * New upstream version. Added: trunk/xen-3/debian/lib/python/debian_xen/__init__.py =============================================================================--- (empty file) +++ trunk/xen-3/debian/lib/python/debian_xen/__init__.py Thu Aug 2 10:08:29 2007 @@ -0,0 +1,19 @@ +def _setup(): + import os.path, sys + version = None + rules = os.path.join(__path__[0], "../../../rules.defs") + f = file(rules) + for l in f: + l = l.strip().split() + if l[0] == ''KERNELVERSION'': + version = l[-1] + f.close() + if version is None: + raise RuntimeError("Can''t find KERNELVERSION setting") + global support + support = ''/usr/src/linux-support-%s'' % version + if not os.path.exists(support): + raise RuntimeError("Can''t find %s" % support) + sys.path.append(''%s/lib/python'' % support) + +_setup() Added: trunk/xen-3/debian/lib/python/debian_xen/debian.py =============================================================================--- (empty file) +++ trunk/xen-3/debian/lib/python/debian_xen/debian.py Thu Aug 2 10:08:29 2007 @@ -0,0 +1,34 @@ +import re +from debian_linux.debian import Version + +class VersionXen(Version): + _version_xen_rules = ur""" +^ +(?P<version> + (?P<major>\d+) + \.\d+ +) +\.\d+ +(?: + \+hg + (?P<hg_rev> + \d+ + ) +)? +- +(?:[^-]+) +$ +""" + _version_xen_re = re.compile(_version_xen_rules, re.X) + + def __init__(self, version): + super(VersionXen, self).__init__(version) + match = self._version_xen_re.match(version) + if match is None: + raise ValueError("Invalid debian xen version") + d = match.groupdict() + self.xen_major = d[''major''] + self.xen_version = d[''version''] + +if __name__ == ''__main__'': + gencontrol()() Modified: trunk/xen-3/debian/rules =============================================================================--- trunk/xen-3/debian/rules (original) +++ trunk/xen-3/debian/rules Thu Aug 2 10:08:29 2007 @@ -66,7 +66,7 @@ debian/control-real: $(CONTROL_FILES) - debian/bin/gencontrol.py $(KERNELVERSION) /usr/src/linux-support-$(KERNELVERSION) + debian/bin/gencontrol.py md5sum $^ > debian/control.md5sum @echo @echo This target is made to fail intentionally, to make sure Modified: trunk/xen-3/debian/rules.defs =============================================================================--- trunk/xen-3/debian/rules.defs (original) +++ trunk/xen-3/debian/rules.defs Thu Aug 2 10:08:29 2007 @@ -1,4 +1,4 @@ -KERNELVERSION := 2.6.18-4 +KERNELVERSION := 2.6.22-1 MAJOR := 3.1 BUILD_DIR = debian/build STAMPS_DIR = debian/stamps Modified: trunk/xen-3/debian/rules.real =============================================================================--- trunk/xen-3/debian/rules.real (original) +++ trunk/xen-3/debian/rules.real Thu Aug 2 10:08:29 2007 @@ -76,7 +76,7 @@ dh_builddeb install-docs: DIR=$(BUILD_DIR)/build-docs -install-docs: PACKAGE_NAME = xen-docs-$(SHORT_VERSION) +install-docs: PACKAGE_NAME = xen-docs-$(VERSION) install-docs: DH_OPTIONS = -p$(PACKAGE_NAME) install-docs: $(STAMPS_DIR)/build-docs dh_testdir Modified: trunk/xen-3/debian/templates/control.hypervisor.in =============================================================================--- trunk/xen-3/debian/templates/control.hypervisor.in (original) +++ trunk/xen-3/debian/templates/control.hypervisor.in Thu Aug 2 10:08:29 2007 @@ -1,7 +1,7 @@ Package: xen-hypervisor- at version@@abiname@@localversion@ Depends: xen-utils- at version@@abiname@ Provides: xen-hypervisor, xen-hypervisor- at major@, xen-hypervisor- at version@@abiname@, xen-hypervisor at localversion@ -Suggests: xen-docs- at short_version@ +Suggests: xen-docs- at version@ Description: The Xen Hypervisor on @class@ The hypervisor is the "core" for XEN itself. It gets booted by the boot loader and controls cpu and memory, sharing them between your administrative domain Modified: trunk/xen-3/debian/templates/control.main.in =============================================================================--- trunk/xen-3/debian/templates/control.main.in (original) +++ trunk/xen-3/debian/templates/control.main.in Thu Aug 2 10:08:29 2007 @@ -1,4 +1,4 @@ -Package: xen-docs- at short_version@ +Package: xen-docs- at version@ Architecture: all Description: documentation for XEN, a Virtual Machine Monitor This package contains all the large documentation files for XEN. This Modified: trunk/xen-3/debian/templates/control.utils.in =============================================================================--- trunk/xen-3/debian/templates/control.utils.in (original) +++ trunk/xen-3/debian/templates/control.utils.in Thu Aug 2 10:08:29 2007 @@ -2,7 +2,7 @@ Depends: ${shlibs:Depends}, ${python:Depends}, xen-utils-common (>= 3.0+hg11624-2), iproute, udev (>> 0.060) Recommends: bridge-utils, libc6-xen [i386], xen-hypervisor- at version@@abiname@ Provides: xen-utils -Suggests: xen-docs- at short_version@ +Suggests: xen-docs- at version@ XB-Python-Version: ${python:Versions} Description: XEN administrative tools The userspace tools to manage a system virtualized through the XEN virtual