Merge ~cjwatson/launchpad-buildd:py3-on-bionic into launchpad-buildd:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: d36cd0b6772302554b88ae1ea3bc8155a69a4e66
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad-buildd:py3-on-bionic
Merge into: launchpad-buildd:master
Diff against target: 191 lines (+46/-15)
14 files modified
bin/buildrecipe (+1/-1)
bin/check-implicit-pointer-functions (+1/-1)
bin/in-target (+1/-1)
bin/test_buildd_generatetranslationtemplates (+1/-1)
bin/test_buildd_recipe (+1/-1)
buildd-genconfig (+1/-1)
debian/changelog (+1/-0)
debian/check-python3-twisted (+9/-0)
debian/control (+3/-3)
debian/launchpad-buildd.init (+1/-1)
debian/rules (+23/-2)
debian/upgrade-config (+1/-1)
lpbuildd/check_implicit_pointer_functions.py (+1/-1)
setup.py (+1/-1)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+383615@code.launchpad.net

Commit message

Run on Python 3 when built for >= bionic

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) wrote :

looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/buildrecipe b/bin/buildrecipe
index d20820a..f3034e7 100755
--- a/bin/buildrecipe
+++ b/bin/buildrecipe
@@ -1,4 +1,4 @@
1#!/usr/bin/python -u1#!/usr/bin/python3 -u
2# Copyright 2010-2019 Canonical Ltd. This software is licensed under the2# Copyright 2010-2019 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).3# GNU Affero General Public License version 3 (see the file LICENSE).
44
diff --git a/bin/check-implicit-pointer-functions b/bin/check-implicit-pointer-functions
index 6e20f3f..7ff5389 100755
--- a/bin/check-implicit-pointer-functions
+++ b/bin/check-implicit-pointer-functions
@@ -1,4 +1,4 @@
1#! /usr/bin/python -u1#! /usr/bin/python3 -u
2#2#
3# Copyright 2020 Canonical Ltd. This software is licensed under the3# Copyright 2020 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
diff --git a/bin/in-target b/bin/in-target
index 73db48a..da0303d 100755
--- a/bin/in-target
+++ b/bin/in-target
@@ -1,4 +1,4 @@
1#! /usr/bin/python -u1#! /usr/bin/python3 -u
2#2#
3# Copyright 2017 Canonical Ltd. This software is licensed under the3# Copyright 2017 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
diff --git a/bin/test_buildd_generatetranslationtemplates b/bin/test_buildd_generatetranslationtemplates
index 5bfaae0..85ddc2e 100755
--- a/bin/test_buildd_generatetranslationtemplates
+++ b/bin/test_buildd_generatetranslationtemplates
@@ -1,4 +1,4 @@
1#!/usr/bin/env python1#!/usr/bin/python3
2# Copyright 2010 Canonical Ltd. This software is licensed under the2# Copyright 2010 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).3# GNU Affero General Public License version 3 (see the file LICENSE).
4#4#
diff --git a/bin/test_buildd_recipe b/bin/test_buildd_recipe
index aa4c2bb..849b28b 100755
--- a/bin/test_buildd_recipe
+++ b/bin/test_buildd_recipe
@@ -1,4 +1,4 @@
1#!/usr/bin/env python1#!/usr/bin/python3
2# Copyright 2010 Canonical Ltd. This software is licensed under the2# Copyright 2010 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).3# GNU Affero General Public License version 3 (see the file LICENSE).
4#4#
diff --git a/buildd-genconfig b/buildd-genconfig
index c1f61ec..467dee4 100755
--- a/buildd-genconfig
+++ b/buildd-genconfig
@@ -1,4 +1,4 @@
1#!/usr/bin/python1#!/usr/bin/python3
2#2#
3# Copyright 2009 Canonical Ltd. This software is licensed under the3# Copyright 2009 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
diff --git a/debian/changelog b/debian/changelog
index 006223d..91b8886 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,7 @@ launchpad-buildd (190) UNRELEASED; urgency=medium
24 * Add a proper wrapper for check-implicit-pointer-functions.24 * Add a proper wrapper for check-implicit-pointer-functions.
25 * Add a python3-lpbuildd binary package.25 * Add a python3-lpbuildd binary package.
26 * Fix LXD.run to not default to universal_newlines=True.26 * Fix LXD.run to not default to universal_newlines=True.
27 * Run on Python 3 when built for >= bionic.
2728
28 -- Colin Watson <cjwatson@ubuntu.com> Tue, 28 Apr 2020 10:19:27 +010029 -- Colin Watson <cjwatson@ubuntu.com> Tue, 28 Apr 2020 10:19:27 +0100
2930
diff --git a/debian/check-python3-twisted b/debian/check-python3-twisted
30new file mode 10075531new file mode 100755
index 0000000..21331e8
--- /dev/null
+++ b/debian/check-python3-twisted
@@ -0,0 +1,9 @@
1#! /usr/bin/python3
2
3import sys
4
5import twisted
6
7
8ok = (twisted.version.major, twisted.version.minor) >= (16, 4)
9sys.exit(0 if ok else 1)
diff --git a/debian/control b/debian/control
index eb4ceef..7f19082 100644
--- a/debian/control
+++ b/debian/control
@@ -66,9 +66,9 @@ Depends: adduser,
66 lxd,66 lxd,
67 ntpdate,67 ntpdate,
68 pristine-tar,68 pristine-tar,
69 python,69 ${lpbuildd-python-prefix},
70 python-apt,70 ${lpbuildd-python-prefix}-apt,
71 python-lpbuildd (=${source:Version}),71 ${lpbuildd-python-prefix}-lpbuildd (= ${source:Version}),
72 sbuild,72 sbuild,
73 schroot,73 schroot,
74 sudo,74 sudo,
diff --git a/debian/launchpad-buildd.init b/debian/launchpad-buildd.init
index 13ab745..4952893 100755
--- a/debian/launchpad-buildd.init
+++ b/debian/launchpad-buildd.init
@@ -79,7 +79,7 @@ d_start() {
79 # Useful for certain kinds of image builds.79 # Useful for certain kinds of image builds.
80 modprobe nbd || true80 modprobe nbd || true
8181
82 su - buildd -c "BUILDD_SLAVE_CONFIG=$CONFROOT/$CONF twistd --no_save --pidfile $PIDFILE --python $TACFILE --logfile $LOGFILE --umask 022"82 su - buildd -c "BUILDD_SLAVE_CONFIG=$CONFROOT/$CONF twistd3 --no_save --pidfile $PIDFILE --python $TACFILE --logfile $LOGFILE --umask 022"
83}83}
8484
85#85#
diff --git a/debian/rules b/debian/rules
index 07aee67..2746afa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,16 +7,37 @@
77
8export PYBUILD_NAME := lpbuildd8export PYBUILD_NAME := lpbuildd
99
10export LIBDIR := $(shell python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')10ifeq (ok,$(shell debian/check-python3-twisted && echo ok))
11 export LPBUILDD_PYTHON_PREFIX := python3
12 export LIBDIR := $(shell python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
13else
14 export LPBUILDD_PYTHON_PREFIX := python
15 export LIBDIR := $(shell python2 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
16endif
1117
12%:18%:
13 dh $@ --with=python2,python3 --buildsystem=pybuild19 dh $@ --with=python2,python3 --buildsystem=pybuild
1420
15override_dh_auto_build:21override_dh_auto_build:
16 dh_auto_build22 dh_auto_build
17 python buildd-genconfig --template=template-buildd-slave.conf \23 python3 buildd-genconfig --template=template-buildd-slave.conf \
18 --arch=i386 --port=8221 --name=default --host=buildd.buildd \24 --arch=i386 --port=8221 --name=default --host=buildd.buildd \
19 > buildd-slave-example.conf25 > buildd-slave-example.conf
2026
27ifeq ($(LPBUILDD_PYTHON_PREFIX),python)
28override_dh_install:
29 dh_install
30 find debian/launchpad-buildd -type f | xargs grep -l '#!.*python3' | \
31 xargs -r sed -i 's/\(#!.*\)python3/\1python2/'
32
33override_dh_installinit:
34 dh_installinit
35 sed -i 's/twistd3/twistd/' \
36 debian/launchpad-buildd/etc/init.d/launchpad-buildd
37endif
38
39override_dh_gencontrol:
40 dh_gencontrol -- -Vlpbuildd-python-prefix=$(LPBUILDD_PYTHON_PREFIX)
41
21override_dh_builddeb:42override_dh_builddeb:
22 dh_builddeb -- -Zgzip43 dh_builddeb -- -Zgzip
diff --git a/debian/upgrade-config b/debian/upgrade-config
index 6f1ac77..3c7b9d4 100755
--- a/debian/upgrade-config
+++ b/debian/upgrade-config
@@ -1,4 +1,4 @@
1#!/usr/bin/python1#!/usr/bin/python3
2#2#
3# Copyright 2009-2020 Canonical Ltd. This software is licensed under the3# Copyright 2009-2020 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
diff --git a/lpbuildd/check_implicit_pointer_functions.py b/lpbuildd/check_implicit_pointer_functions.py
index 26372ae..9b8b191 100755
--- a/lpbuildd/check_implicit_pointer_functions.py
+++ b/lpbuildd/check_implicit_pointer_functions.py
@@ -1,4 +1,4 @@
1#!/usr/bin/env python1#!/usr/bin/python3
22
3#3#
4# Copyright (c) 2004 Hewlett-Packard Development Company, L.P.4# Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
diff --git a/setup.py b/setup.py
index 82ae655..32e4498 100755
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
1#!/usr/bin/env python1#!/usr/bin/python3
22
3# Copyright 2015-2019 Canonical Ltd. All rights reserved.3# Copyright 2015-2019 Canonical Ltd. All rights reserved.
4#4#

Subscribers

People subscribed via source and target branches