From b311cebaedaf144228360c898fe96132afbb726b Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 4 Sep 2019 16:21:53 -0300 Subject: [PATCH] More requestsync porting and cleanup --- debian/control | 1 - requestsync | 48 +++++++++++++++++++++++++----------------------- setup.py | 2 +- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/debian/control b/debian/control index 8669c08..208a5bd 100644 --- a/debian/control +++ b/debian/control @@ -88,7 +88,6 @@ Recommends: patch, pbuilder | cowbuilder | sbuild, python3-dns, - python3-launchpadlib, python-soappy, quilt, reportbug (>= 3.39ubuntu1), diff --git a/requestsync b/requestsync index e96613b..30b5149 100755 --- a/requestsync +++ b/requestsync @@ -115,8 +115,8 @@ def main(): elif options.lpinstance == 'staging': bug_mail_domain = 'bugs.staging.launchpad.net' else: - print(('Error: Unknown launchpad instance: %s' - % options.lpinstance), file=sys.stderr) + print('Error: Unknown launchpad instance: %s' % options.lpinstance, + file=sys.stderr) sys.exit(1) mailserver_host = config.get_value('SMTP_SERVER', @@ -130,8 +130,8 @@ def main(): firstmx = mxlist[0] mailserver_host = firstmx[1] except ImportError: - print(('Please install python-dns to support ' - 'Launchpad mail server lookup.'), file=sys.stderr) + print('Please install python3-dns to support Launchpad mail ' + 'server lookup.', file=sys.stderr) sys.exit(1) mailserver_port = config.get_value('SMTP_PORT', default=25, @@ -167,9 +167,9 @@ def main(): get_ubuntu_delta_changelog, mail_bug, need_sponsorship) if not any(x in os.environ for x in ('UBUMAIL', 'DEBEMAIL', 'EMAIL')): - print(( - 'E: The environment variable UBUMAIL, DEBEMAIL or EMAIL needs ' - 'to be set to let this script mail the sync request.'), file=sys.stderr) + print('E: The environment variable UBUMAIL, DEBEMAIL or EMAIL ' + 'needs to be set to let this script mail the sync request.', + file=sys.stderr) sys.exit(1) newsource = options.newpkg @@ -187,7 +187,8 @@ def main(): else: ubu_info = UbuntuDistroInfo() release = ubu_info.devel() - print('W: Target release missing - assuming %s' % release, file=sys.stderr) + print('W: Target release missing - assuming %s' % release, + file=sys.stderr) elif len(args) == 2: release = args[1] elif len(args) == 3: @@ -209,8 +210,9 @@ def main(): ubuntu_version = Version('~') ubuntu_component = None # Set after getting the Debian info if not newsource: - print(("'%s' doesn't exist in 'Ubuntu %s'.\nDo you want to sync a new package?" % - (srcpkg, release))) + print(("'%s' doesn't exist in 'Ubuntu %s'.\n" + "Do you want to sync a new package?") + % (srcpkg, release)) confirmation_prompt() newsource = True except udtexceptions.SeriesNotFoundException as error: @@ -248,13 +250,13 @@ def main(): sys.exit(1) if ubuntu_version == debian_version: - print(('E: The versions in Debian and Ubuntu are the ' - 'same already (%s). Aborting.' % ubuntu_version), file=sys.stderr) + print('E: The versions in Debian and Ubuntu are the same already ' + '(%s). Aborting.' % ubuntu_version, file=sys.stderr) sys.exit(1) if ubuntu_version > debian_version: - print(('E: The version in Ubuntu (%s) is newer than ' - 'the version in Debian (%s). Aborting.' - % (ubuntu_version, debian_version)), file=sys.stderr) + print(('E: The version in Ubuntu (%s) is newer than the version in ' + 'Debian (%s). Aborting.') + % (ubuntu_version, debian_version), file=sys.stderr) sys.exit(1) # -s flag not specified - check if we do need sponsorship @@ -262,8 +264,8 @@ def main(): sponsorship = need_sponsorship(srcpkg, ubuntu_component, release) if not sponsorship and not ffe: - print(('Consider using syncpackage(1) for syncs that ' - 'do not require feature freeze exceptions.'), file=sys.stderr) + print('Consider using syncpackage(1) for syncs that do not require ' + 'feature freeze exceptions.', file=sys.stderr) # Check for existing package reports if not newsource: @@ -310,10 +312,10 @@ def main(): changelog = debian_srcpkg.getChangelog(since_version=base_version) if not changelog: if not options.missing_changelog_ok: - print(("E: Did not retrieve any changelog entries. " - "Do you need to specify '-C'? " - "Was the package recently uploaded? (check " - "http://packages.debian.org/changelogs/)"), file=sys.stderr) + print("E: Did not retrieve any changelog entries. " + "Do you need to specify '-C'? " + "Was the package recently uploaded? (check " + "http://packages.debian.org/changelogs/)", file=sys.stderr) sys.exit(1) else: need_interaction = True @@ -325,8 +327,8 @@ def main(): title, report = editor.get_report() if 'XXX FIXME' in report: - print(("E: changelog boilerplate found in report, " - "please manually add changelog when using '-C'"), file=sys.stderr) + print("E: changelog boilerplate found in report, please manually add " + "changelog when using '-C'", file=sys.stderr) sys.exit(1) # bug status and bug subscriber diff --git a/setup.py b/setup.py index e829a15..550ada0 100755 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ if sys.version_info[0] >= 3: 'pull-revu-source', 'pull-uca-source', 'requestbackport', + 'requestsync', 'reverse-build-depends', 'setup-packaging-environment', ] @@ -47,7 +48,6 @@ else: scripts = [ 'import-bug-from-debian', 'merge-changelog', - 'requestsync', 'reverse-depends', 'seeded-in-ubuntu', 'sponsor-patch',