mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-09 16:01:28 +00:00
backportpackage: improve python3 compatibility
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
This commit is contained in:
parent
6fea8fb542
commit
bf52bd6fa3
@ -182,7 +182,7 @@ def find_release_package(mirror, workdir, package, version, source_release,
|
|||||||
archive = Distribution(distribution.lower()).getArchive()
|
archive = Distribution(distribution.lower()).getArchive()
|
||||||
try:
|
try:
|
||||||
spph = archive.getSourcePackage(package, source_release)
|
spph = archive.getSourcePackage(package, source_release)
|
||||||
except (SeriesNotFoundException, PackageNotFoundException), e:
|
except (SeriesNotFoundException, PackageNotFoundException) as e:
|
||||||
error(str(e))
|
error(str(e))
|
||||||
version = spph.getVersion()
|
version = spph.getVersion()
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ def get_old_version(source, release):
|
|||||||
('Release', 'Security', 'Updates',
|
('Release', 'Security', 'Updates',
|
||||||
'Proposed', 'Backports'))
|
'Proposed', 'Backports'))
|
||||||
return pkg.getVersion()
|
return pkg.getVersion()
|
||||||
except (SeriesNotFoundException, PackageNotFoundException), e:
|
except (SeriesNotFoundException, PackageNotFoundException) as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_backport_dist(release, release_pocket):
|
def get_backport_dist(release, release_pocket):
|
||||||
@ -265,8 +265,8 @@ def do_build(workdir, dsc, release, builder, update):
|
|||||||
os.path.join(workdir, "buildresult"))
|
os.path.join(workdir, "buildresult"))
|
||||||
|
|
||||||
def do_upload(workdir, package, bp_version, changes, upload, prompt):
|
def do_upload(workdir, package, bp_version, changes, upload, prompt):
|
||||||
print 'Please check %s %s in file://%s carefully!' % \
|
print('Please check %s %s in file://%s carefully!' % \
|
||||||
(package, bp_version, workdir)
|
(package, bp_version, workdir))
|
||||||
if prompt or upload == 'ubuntu':
|
if prompt or upload == 'ubuntu':
|
||||||
question = 'Do you want to upload the package to %s' % upload
|
question = 'Do you want to upload the package to %s' % upload
|
||||||
answer = YesNoQuestion().ask(question, "yes")
|
answer = YesNoQuestion().ask(question, "yes")
|
||||||
@ -295,7 +295,7 @@ def orig_needed(upload, workdir, pkg):
|
|||||||
not headers['content-location'].
|
not headers['content-location'].
|
||||||
startswith('https://launchpadlibrarian.net')):
|
startswith('https://launchpadlibrarian.net')):
|
||||||
return True
|
return True
|
||||||
except HttpLib2Error, e:
|
except HttpLib2Error as e:
|
||||||
Logger.info(e)
|
Logger.info(e)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -406,7 +406,7 @@ def main(args):
|
|||||||
opts.upload,
|
opts.upload,
|
||||||
opts.keyid,
|
opts.keyid,
|
||||||
opts.prompt)
|
opts.prompt)
|
||||||
except DownloadError, e:
|
except DownloadError as e:
|
||||||
error(str(e))
|
error(str(e))
|
||||||
finally:
|
finally:
|
||||||
if not opts.workdir:
|
if not opts.workdir:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user