Update requestsync to python3 (Closes: #927147)

This commit is contained in:
Scott Kitterman 2019-09-04 16:11:24 -03:00 committed by Stefano Rivera
parent 7c0efe2914
commit 81b17cd323
3 changed files with 39 additions and 34 deletions

4
debian/changelog vendored
View File

@ -1,9 +1,13 @@
ubuntu-dev-tools (0.173) UNRELEASED; urgency=medium ubuntu-dev-tools (0.173) UNRELEASED; urgency=medium
[ Stefano Rivera ]
* pull-debian-debdiff: Don't unpack the older source package, it will often * pull-debian-debdiff: Don't unpack the older source package, it will often
use the same directory as the newer one, and break. use the same directory as the newer one, and break.
* Drop 404main, it's been totally broken for years. * Drop 404main, it's been totally broken for years.
[ Scott Kitterman ]
* Update requestsync to python3 (Closes: #927147)
-- Stefano Rivera <stefanor@debian.org> Wed, 04 Sep 2019 16:31:28 -0300 -- Stefano Rivera <stefanor@debian.org> Wed, 04 Sep 2019 16:31:28 -0300
ubuntu-dev-tools (0.172) unstable; urgency=medium ubuntu-dev-tools (0.172) unstable; urgency=medium

3
debian/control vendored
View File

@ -87,7 +87,8 @@ Recommends:
lintian, lintian,
patch, patch,
pbuilder | cowbuilder | sbuild, pbuilder | cowbuilder | sbuild,
python-dns, python3-dns,
python3-launchpadlib,
python-soappy, python-soappy,
quilt, quilt,
reportbug (>= 3.39ubuntu1), reportbug (>= 3.39ubuntu1),

View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# (C) 2007 Canonical Ltd., Steve Kowalik # (C) 2007 Canonical Ltd., Steve Kowalik
@ -97,7 +97,7 @@ def main():
config = UDTConfig(options.no_conf) config = UDTConfig(options.no_conf)
if options.deprecated_lp_flag: if options.deprecated_lp_flag:
print "The --lp flag is now default, ignored." print("The --lp flag is now default, ignored.")
if options.email: if options.email:
options.lpapi = False options.lpapi = False
else: else:
@ -115,8 +115,8 @@ def main():
elif options.lpinstance == 'staging': elif options.lpinstance == 'staging':
bug_mail_domain = 'bugs.staging.launchpad.net' bug_mail_domain = 'bugs.staging.launchpad.net'
else: else:
print >> sys.stderr, ('Error: Unknown launchpad instance: %s' print(('Error: Unknown launchpad instance: %s'
% options.lpinstance) % options.lpinstance), file=sys.stderr)
sys.exit(1) sys.exit(1)
mailserver_host = config.get_value('SMTP_SERVER', mailserver_host = config.get_value('SMTP_SERVER',
@ -130,8 +130,8 @@ def main():
firstmx = mxlist[0] firstmx = mxlist[0]
mailserver_host = firstmx[1] mailserver_host = firstmx[1]
except ImportError: except ImportError:
print >> sys.stderr, ('Please install python-dns to support ' print(('Please install python-dns to support '
'Launchpad mail server lookup.') 'Launchpad mail server lookup.'), file=sys.stderr)
sys.exit(1) sys.exit(1)
mailserver_port = config.get_value('SMTP_PORT', default=25, mailserver_port = config.get_value('SMTP_PORT', default=25,
@ -167,9 +167,9 @@ def main():
get_ubuntu_delta_changelog, get_ubuntu_delta_changelog,
mail_bug, need_sponsorship) mail_bug, need_sponsorship)
if not any(x in os.environ for x in ('UBUMAIL', 'DEBEMAIL', 'EMAIL')): if not any(x in os.environ for x in ('UBUMAIL', 'DEBEMAIL', 'EMAIL')):
print >> sys.stderr, ( print((
'E: The environment variable UBUMAIL, DEBEMAIL or EMAIL needs ' 'E: The environment variable UBUMAIL, DEBEMAIL or EMAIL needs '
'to be set to let this script mail the sync request.') 'to be set to let this script mail the sync request.'), file=sys.stderr)
sys.exit(1) sys.exit(1)
newsource = options.newpkg newsource = options.newpkg
@ -187,14 +187,14 @@ def main():
else: else:
ubu_info = UbuntuDistroInfo() ubu_info = UbuntuDistroInfo()
release = ubu_info.devel() release = ubu_info.devel()
print >> sys.stderr, 'W: Target release missing - assuming %s' % release print('W: Target release missing - assuming %s' % release, file=sys.stderr)
elif len(args) == 2: elif len(args) == 2:
release = args[1] release = args[1]
elif len(args) == 3: elif len(args) == 3:
release = args[1] release = args[1]
force_base_version = Version(args[2]) force_base_version = Version(args[2])
else: else:
print >> sys.stderr, 'E: Too many arguments.' print('E: Too many arguments.', file=sys.stderr)
parser.print_help() parser.print_help()
sys.exit(1) sys.exit(1)
@ -209,12 +209,12 @@ def main():
ubuntu_version = Version('~') ubuntu_version = Version('~')
ubuntu_component = None # Set after getting the Debian info ubuntu_component = None # Set after getting the Debian info
if not newsource: if not newsource:
print("'%s' doesn't exist in 'Ubuntu %s'.\nDo you want to sync a new package?" % print(("'%s' doesn't exist in 'Ubuntu %s'.\nDo you want to sync a new package?" %
(srcpkg, release)) (srcpkg, release)))
confirmation_prompt() confirmation_prompt()
newsource = True newsource = True
except udtexceptions.SeriesNotFoundException, error: except udtexceptions.SeriesNotFoundException as error:
print >> sys.stderr, "E: %s" % error print("E: %s" % error, file=sys.stderr)
sys.exit(1) sys.exit(1)
# Get the requested Debian source package # Get the requested Debian source package
@ -222,11 +222,11 @@ def main():
debian_srcpkg = get_debian_srcpkg(srcpkg, distro) debian_srcpkg = get_debian_srcpkg(srcpkg, distro)
debian_version = Version(debian_srcpkg.getVersion()) debian_version = Version(debian_srcpkg.getVersion())
debian_component = debian_srcpkg.getComponent() debian_component = debian_srcpkg.getComponent()
except udtexceptions.PackageNotFoundException, error: except udtexceptions.PackageNotFoundException as error:
print >> sys.stderr, "E: %s" % error print("E: %s" % error, file=sys.stderr)
sys.exit(1) sys.exit(1)
except udtexceptions.SeriesNotFoundException, error: except udtexceptions.SeriesNotFoundException as error:
print >> sys.stderr, "E: %s" % error print("E: %s" % error, file=sys.stderr)
sys.exit(1) sys.exit(1)
if ubuntu_component is None: if ubuntu_component is None:
@ -243,18 +243,18 @@ def main():
debian_srcpkg = ubuntutools.requestsync.mail.get_debian_srcpkg(srcpkg, distro) debian_srcpkg = ubuntutools.requestsync.mail.get_debian_srcpkg(srcpkg, distro)
debian_version = Version(debian_srcpkg.getVersion()) debian_version = Version(debian_srcpkg.getVersion())
debian_component = debian_srcpkg.getComponent() debian_component = debian_srcpkg.getComponent()
except udtexceptions.PackageNotFoundException, error: except udtexceptions.PackageNotFoundException as error:
print >> sys.stderr, "E: %s" % error print("E: %s" % error, file=sys.stderr)
sys.exit(1) sys.exit(1)
if ubuntu_version == debian_version: if ubuntu_version == debian_version:
print >> sys.stderr, ('E: The versions in Debian and Ubuntu are the ' print(('E: The versions in Debian and Ubuntu are the '
'same already (%s). Aborting.' % ubuntu_version) 'same already (%s). Aborting.' % ubuntu_version), file=sys.stderr)
sys.exit(1) sys.exit(1)
if ubuntu_version > debian_version: if ubuntu_version > debian_version:
print >> sys.stderr, ('E: The version in Ubuntu (%s) is newer than ' print(('E: The version in Ubuntu (%s) is newer than '
'the version in Debian (%s). Aborting.' 'the version in Debian (%s). Aborting.'
% (ubuntu_version, debian_version)) % (ubuntu_version, debian_version)), file=sys.stderr)
sys.exit(1) sys.exit(1)
# -s flag not specified - check if we do need sponsorship # -s flag not specified - check if we do need sponsorship
@ -262,8 +262,8 @@ def main():
sponsorship = need_sponsorship(srcpkg, ubuntu_component, release) sponsorship = need_sponsorship(srcpkg, ubuntu_component, release)
if not sponsorship and not ffe: if not sponsorship and not ffe:
print >> sys.stderr, ('Consider using syncpackage(1) for syncs that ' print(('Consider using syncpackage(1) for syncs that '
'do not require feature freeze exceptions.') 'do not require feature freeze exceptions.'), file=sys.stderr)
# Check for existing package reports # Check for existing package reports
if not newsource: if not newsource:
@ -284,8 +284,8 @@ def main():
print('Changes have been made to the package in Ubuntu.\n' print('Changes have been made to the package in Ubuntu.\n'
'Please edit the report and give an explanation.\n' 'Please edit the report and give an explanation.\n'
'Not saving the report file will abort the request.') 'Not saving the report file will abort the request.')
report += (u'Explanation of the Ubuntu delta and why it can be ' report += ('Explanation of the Ubuntu delta and why it can be '
u'dropped:\n%s\n>>> ENTER_EXPLANATION_HERE <<<\n\n' 'dropped:\n%s\n>>> ENTER_EXPLANATION_HERE <<<\n\n'
% get_ubuntu_delta_changelog(ubuntu_srcpkg)) % get_ubuntu_delta_changelog(ubuntu_srcpkg))
if ffe: if ffe:
@ -310,10 +310,10 @@ def main():
changelog = debian_srcpkg.getChangelog(since_version=base_version) changelog = debian_srcpkg.getChangelog(since_version=base_version)
if not changelog: if not changelog:
if not options.missing_changelog_ok: if not options.missing_changelog_ok:
print >> sys.stderr, ("E: Did not retrieve any changelog entries. " print(("E: Did not retrieve any changelog entries. "
"Do you need to specify '-C'? " "Do you need to specify '-C'? "
"Was the package recently uploaded? (check " "Was the package recently uploaded? (check "
"http://packages.debian.org/changelogs/)") "http://packages.debian.org/changelogs/)"), file=sys.stderr)
sys.exit(1) sys.exit(1)
else: else:
need_interaction = True need_interaction = True
@ -325,8 +325,8 @@ def main():
title, report = editor.get_report() title, report = editor.get_report()
if 'XXX FIXME' in report: if 'XXX FIXME' in report:
print >> sys.stderr, ("E: changelog boilerplate found in report, " print(("E: changelog boilerplate found in report, "
"please manually add changelog when using '-C'") "please manually add changelog when using '-C'"), file=sys.stderr)
sys.exit(1) sys.exit(1)
# bug status and bug subscriber # bug status and bug subscriber
@ -357,5 +357,5 @@ if __name__ == '__main__':
try: try:
main() main()
except KeyboardInterrupt: except KeyboardInterrupt:
print "\nUser abort." print("\nUser abort.")
sys.exit(2) sys.exit(2)