mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-10 08:21:29 +00:00
backportpackage: Print real error messages instead of relying on subprocess.check_call backtraces
This commit is contained in:
parent
158c4f3693
commit
0f01b0752c
@ -77,15 +77,17 @@ def main(args):
|
|||||||
bp_version += '~ppa1'
|
bp_version += '~ppa1'
|
||||||
elif upload == 'ubuntu':
|
elif upload == 'ubuntu':
|
||||||
bp_dist += '-backports'
|
bp_dist += '-backports'
|
||||||
subprocess.check_call(['dch',
|
if not subprocess.call(['dch',
|
||||||
'--force-bad-version',
|
'--force-bad-version',
|
||||||
'--preserve',
|
'--preserve',
|
||||||
'--newversion', bp_version,
|
'--newversion', bp_version,
|
||||||
'--distribution', dest_release,
|
'--distribution', dest_release,
|
||||||
'No-change backport to %s' % dest_release],
|
'No-change backport to %s' % dest_release],
|
||||||
cwd=srcdir)
|
cwd=srcdir):
|
||||||
subprocess.check_call(['debuild', '-S'],
|
error('Something went wrong updating the package changelog')
|
||||||
cwd=srcdir)
|
if not subprocess.check_call(['debuild', '-S'],
|
||||||
|
cwd=srcdir):
|
||||||
|
error('Something went wrong while building the source package')
|
||||||
|
|
||||||
if ':' in bp_version:
|
if ':' in bp_version:
|
||||||
bp_version = bp_version[bp_version.find(':')+1:]
|
bp_version = bp_version[bp_version.find(':')+1:]
|
||||||
@ -98,10 +100,11 @@ def main(args):
|
|||||||
elif answer in ('n', 'no'):
|
elif answer in ('n', 'no'):
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
subprocess.check_call(['dput',
|
if not subprocess.check_call(['dput',
|
||||||
upload,
|
upload,
|
||||||
'%s_%s_source.changes' % (package, bp_version)],
|
'%s_%s_source.changes' % (package, bp_version)],
|
||||||
cwd=tmpdir)
|
cwd=tmpdir):
|
||||||
|
error('Something went wrong uploading the package %s to %s' % package, upload)
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(tmpdir)
|
shutil.rmtree(tmpdir)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user