Skip to content
Snippets Groups Projects
Commit 1e8004f5 authored by Piotr Ożarowski's avatar Piotr Ożarowski
Browse files

Replace /usr/bin/dh_python2 with a Python script that invokes

dh-python's dh_python2 if Build-Depends{,-Indep} contains dh-python
parent fdfbb651
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ install-dev:
$(INSTALL) -m 755 runtime.d/* $(DESTDIR)$(PREFIX)/share/python/runtime.d/
$(INSTALL) -m 644 autoscripts/* $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts/
$(INSTALL) -m 755 dh_python2 $(DESTDIR)$(PREFIX)/share/python/
$(INSTALL) -m 755 dh_python2.sh $(DESTDIR)$(PREFIX)/bin/dh_python2
$(INSTALL) -m 755 dh_python2.py $(DESTDIR)$(PREFIX)/bin/dh_python2
$(INSTALL) -m 644 python2.pm $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Sequence/
install-runtime:
......
......@@ -6,6 +6,8 @@ python-defaults (2.7.5-5) unstable; urgency=low
[ Piotr Ożarowski ]
* Set "Multi-Arch: allowed" in python, python-dev, python-minimal,
python-dbg, python-all, python-all-dev, python-all-dbg
* Replace /usr/bin/dh_python2 with a Python script that invokes
dh-python's dh_python2 if Build-Depends{,-Indep} contains dh-python
-- Piotr Ożarowski <piotr@debian.org> Thu, 12 Sep 2013 21:25:01 +0200
......
#! /usr/bin/python
from os.path import exists
from subprocess import call
from sys import argv
from re import compile
OLD = '/usr/share/python/dh_python2'
NEW = '/usr/share/dh-python/dh_python2'
has_dhpython = compile(r'(^|:|\s|,)dh-python($|\s|,|\()').search
binary = OLD
if exists(NEW) and exists('debian/control'):
with open('debian/control', 'r') as fp:
inside = False
for line in fp:
if not line:
break
line_lower = line.lower()
if inside:
if line.startswith(' '):
if has_dhpython(line):
binary = NEW
break
continue
elif line.startswith('#'):
continue
inside = False
if line_lower.startswith(('build-depends:', 'build-depends-indep:')):
if has_dhpython(line):
binary = NEW
break
inside = True
argv[0] = binary
exit(call(argv))
#! /bin/sh
if [ -f /usr/share/dh-python/dh_python2 ] &&\
grep -q dh-python ./debian/control 2>/dev/null
then
exec /usr/share/dh-python/dh_python2 $@
else
exec /usr/share/python/dh_python2 $@
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment