# HG changeset patch # User Denis Laxalde # Date 2019-10-21 08:59:54 # Node ID 7574ccd87200f02e49da64f416c37e43163ba077 # Parent b4b1131187c4801ba4e2c6d4eafbb51d024edf2e packaging: upgrade Debian packaging to build with Python 3 Also drop the explicit "Depends: python" as debhelper will add it. diff --git a/contrib/packaging/debian/control b/contrib/packaging/debian/control --- a/contrib/packaging/debian/control +++ b/contrib/packaging/debian/control @@ -7,20 +7,19 @@ Build-Depends: dh-python, less, netbase, - python-all, - python-all-dev, - python-docutils, + python3-all, + python3-all-dev, + python3-docutils, unzip, zip Standards-Version: 3.9.4 -X-Python-Version: >= 2.7 +X-Python3-Version: >= 3.5 Package: mercurial Depends: - python, ${shlibs:Depends}, ${misc:Depends}, - ${python:Depends}, + ${python3:Depends}, mercurial-common (= ${source:Version}) Architecture: any Description: fast, easy to use, distributed revision control tool. @@ -41,7 +40,7 @@ Package: mercurial-common Architecture: all Depends: ${misc:Depends}, - ${python:Depends}, + ${python3:Depends}, Recommends: mercurial (= ${source:Version}), ca-certificates Suggests: wish Breaks: mercurial (<< ${source:Version}) diff --git a/contrib/packaging/debian/rules b/contrib/packaging/debian/rules --- a/contrib/packaging/debian/rules +++ b/contrib/packaging/debian/rules @@ -4,18 +4,21 @@ CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l) +export HGPYTHON3=1 +export PYTHON=python3 + %: - dh $@ --with python2 + dh $@ --with python3 override_dh_auto_test: http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)" -override_dh_python2: - dh_python2 +override_dh_python3: + dh_python3 find debian/mercurial/usr/share -type d -empty -delete override_dh_install: - python$(PYVERS) setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb + python3 setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb # chg make -C contrib/chg \ DESTDIR="$(CURDIR)"/debian/mercurial \ @@ -25,7 +28,7 @@ override_dh_install: find "$(CURDIR)"/debian/mercurial/usr/lib \ ! -name '*.so' ! -type d -delete , \ -type d -empty -delete - python$(PYVERS) setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb + python3 setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb make install-doc PREFIX="$(CURDIR)"/debian/mercurial-common/usr # remove arch-dependent python stuff find "$(CURDIR)"/debian/mercurial-common/usr/lib \ diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t --- a/tests/test-debian-packages.t +++ b/tests/test-debian-packages.t @@ -17,10 +17,10 @@ Ensure debuild doesn't run the testsuite mercurial_*.deb (glob) main deb should have .so but no .py $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)' - * ./usr/lib/python2.7/dist-packages/mercurial/cext/parsers*.so (glob) + * ./usr/lib/python3/dist-packages/mercurial/cext/parsers*.so (glob) mercurial-common should have py but no .so or pyc $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)' - * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob) + * ./usr/lib/python3/dist-packages/mercurial/localrepo.py (glob) zsh completions should be in the common package $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$' * ./usr/share/zsh/vendor-completions/_hg (glob)