More requestsync porting and cleanup

This commit is contained in:
Stefano Rivera 2019-09-04 16:21:53 -03:00
parent 81b17cd323
commit b311cebaed
3 changed files with 26 additions and 25 deletions

1
debian/control vendored
View File

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

View File

@ -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(('Error: Unknown launchpad instance: %s' print('Error: Unknown launchpad instance: %s' % options.lpinstance,
% options.lpinstance), file=sys.stderr) 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(('Please install python-dns to support ' print('Please install python3-dns to support Launchpad mail '
'Launchpad mail server lookup.'), file=sys.stderr) '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(( print('E: The environment variable UBUMAIL, DEBEMAIL or EMAIL '
'E: The environment variable UBUMAIL, DEBEMAIL or EMAIL needs ' '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) file=sys.stderr)
sys.exit(1) sys.exit(1)
newsource = options.newpkg newsource = options.newpkg
@ -187,7 +187,8 @@ def main():
else: else:
ubu_info = UbuntuDistroInfo() ubu_info = UbuntuDistroInfo()
release = ubu_info.devel() 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: elif len(args) == 2:
release = args[1] release = args[1]
elif len(args) == 3: elif len(args) == 3:
@ -209,8 +210,9 @@ 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'.\n"
(srcpkg, release))) "Do you want to sync a new package?")
% (srcpkg, release))
confirmation_prompt() confirmation_prompt()
newsource = True newsource = True
except udtexceptions.SeriesNotFoundException as error: except udtexceptions.SeriesNotFoundException as error:
@ -248,13 +250,13 @@ def main():
sys.exit(1) sys.exit(1)
if ubuntu_version == debian_version: if ubuntu_version == debian_version:
print(('E: The versions in Debian and Ubuntu are the ' print('E: The versions in Debian and Ubuntu are the same already '
'same already (%s). Aborting.' % ubuntu_version), file=sys.stderr) '(%s). Aborting.' % ubuntu_version, file=sys.stderr)
sys.exit(1) sys.exit(1)
if ubuntu_version > debian_version: if ubuntu_version > debian_version:
print(('E: The version in Ubuntu (%s) is newer than ' print(('E: The version in Ubuntu (%s) is newer than the version in '
'the version in Debian (%s). Aborting.' 'Debian (%s). Aborting.')
% (ubuntu_version, debian_version)), file=sys.stderr) % (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 +264,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(('Consider using syncpackage(1) for syncs that ' print('Consider using syncpackage(1) for syncs that do not require '
'do not require feature freeze exceptions.'), file=sys.stderr) 'feature freeze exceptions.', file=sys.stderr)
# Check for existing package reports # Check for existing package reports
if not newsource: if not newsource:
@ -310,10 +312,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(("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/)"), file=sys.stderr) "http://packages.debian.org/changelogs/)", file=sys.stderr)
sys.exit(1) sys.exit(1)
else: else:
need_interaction = True need_interaction = True
@ -325,8 +327,8 @@ def main():
title, report = editor.get_report() title, report = editor.get_report()
if 'XXX FIXME' in report: if 'XXX FIXME' in report:
print(("E: changelog boilerplate found in report, " print("E: changelog boilerplate found in report, please manually add "
"please manually add changelog when using '-C'"), file=sys.stderr) "changelog when using '-C'", file=sys.stderr)
sys.exit(1) sys.exit(1)
# bug status and bug subscriber # bug status and bug subscriber

View File

@ -34,6 +34,7 @@ if sys.version_info[0] >= 3:
'pull-revu-source', 'pull-revu-source',
'pull-uca-source', 'pull-uca-source',
'requestbackport', 'requestbackport',
'requestsync',
'reverse-build-depends', 'reverse-build-depends',
'setup-packaging-environment', 'setup-packaging-environment',
] ]
@ -47,7 +48,6 @@ else:
scripts = [ scripts = [
'import-bug-from-debian', 'import-bug-from-debian',
'merge-changelog', 'merge-changelog',
'requestsync',
'reverse-depends', 'reverse-depends',
'seeded-in-ubuntu', 'seeded-in-ubuntu',
'sponsor-patch', 'sponsor-patch',