From d1949a72aab69168e9dfa847f82242b1c9ad883e Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 4 Sep 2019 15:29:12 -0300 Subject: [PATCH] Port pbuilder-dist to Python 3 --- debian/control | 1 + pbuilder-dist | 10 +++++----- setup.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/control b/debian/control index f784bce..5759994 100644 --- a/debian/control +++ b/debian/control @@ -64,6 +64,7 @@ Depends: python-ubuntutools, python3, python3-apt, + python3-debian, python3-distro-info, python3-httplib2, python3-launchpadlib, diff --git a/pbuilder-dist b/pbuilder-dist index 914f7a1..415db70 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2007-2010, Siegfried-A. Gevatter , @@ -279,7 +279,7 @@ class PbuilderDist(object): try: codename = debian_info.codename(self.target_distro, default=self.target_distro) - except DistroDataOutdated, error: + except DistroDataOutdated as error: Logger.warn(error) if codename in (debian_info.devel(), 'experimental'): self.enable_security = False @@ -306,7 +306,7 @@ class PbuilderDist(object): else: try: dev_release = self.target_distro == UbuntuDistroInfo().devel() - except DistroDataOutdated, error: + except DistroDataOutdated as error: Logger.warn(error) dev_release = True @@ -396,7 +396,7 @@ def show_help(exit_code=0): Print a help message for pbuilder-dist, and exit with the given code. """ - print 'See man pbuilder-dist for more information.' + print('See man pbuilder-dist for more information.') sys.exit(exit_code) @@ -498,7 +498,7 @@ def main(): if '--debug-echo' not in args: sys.exit(subprocess.call(app.get_command(args))) else: - print app.get_command([arg for arg in args if arg != '--debug-echo']) + print(app.get_command([arg for arg in args if arg != '--debug-echo'])) if __name__ == '__main__': diff --git a/setup.py b/setup.py index 39bacf6..23da03b 100755 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ if sys.version_info[0] >= 3: 'grep-merges', 'hugdaylist', 'mk-sbuild', + 'pbuilder-dist', 'pbuilder-dist-simple', 'pull-debian-source', 'pull-revu-source', @@ -42,7 +43,6 @@ else: scripts = [ 'import-bug-from-debian', 'merge-changelog', - 'pbuilder-dist', 'pull-debian-debdiff', 'pull-lp-source', 'pull-uca-source',