diff --git a/debian/changelog b/debian/changelog index 16dce04d3f95c3ffcffddf83c5290ef72b2a0d89..df482a2731c4fcff9a9a53b675cbca33e4c980f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-defaults (2.6.5-13) UNRELEASED; urgency=low [ Piotr Ożarowski ] * Fix documentation typo in pycompile/pycompile.1 + * dh_python2: Add support for X-Python-Version -- Scott Kitterman <scott@kitterman.com> Tue, 10 Aug 2010 22:27:20 -0400 diff --git a/debpython/debhelper.py b/debpython/debhelper.py index 83d4cc9148785f824e62c7348d9a9f227dfd06e0..46d7b94face752c5acdad01d1015b7bcea2ae3db 100644 --- a/debpython/debhelper.py +++ b/debpython/debhelper.py @@ -78,10 +78,11 @@ class DebHelper(object): 'uses_breaks': False} elif line.startswith('Source:'): self.source_name = line[7:].strip() - elif source_section and line.startswith('XS-Python-Version:'): - # ignore 3.X requirements - self.python_version = re.compile(\ - ',\s>=\s*3.*').sub('', line[18:]) + elif source_section: + if line.startswith('XS-Python-Version:') and not self.python_version: + self.python_version = line[18:].strip() + if line.startswith('X-Python-Version:'): + self.python_version = line[17:].strip() log.debug('source=%s, binary packages=%s', self.source_name, \ self.packages.keys()) diff --git a/dh_python2 b/dh_python2 index e07c6ba6e42fae6234df7967fb84c6c770f625b9..fa329a6f0cee6e4823ad62947759b178c2c43302 100755 --- a/dh_python2 +++ b/dh_python2 @@ -446,7 +446,7 @@ def main(): with open('debian/pyversions') as fp: for line in fp: line = line.strip() - if line: + if line and not line.startswith('#'): options.vrange = parse_vrange(line) break