submittodebian: os.system() doesn't throw exceptions, so attempt a

'bzr diff' first and check the return value; otherwise we get no output
at all from submittodebian in the non-bzr case.
This commit is contained in:
Steve Langasek 2009-12-27 12:58:05 -08:00
parent 0d0b21b353
commit 405535d3e8
2 changed files with 10 additions and 8 deletions

5
debian/changelog vendored
View File

@ -18,6 +18,11 @@ ubuntu-dev-tools (0.86) UNRELEASED; urgency=low
* pull-debian-source: Return the most recent source line. Depend on
libapt-pkg-perl for the Debian version comparison required for this.
[ Steve Langasek ]
* submittodebian: os.system() doesn't throw exceptions, so attempt a
'bzr diff' first and check the return value; otherwise we get no output
at all from submittodebian in the non-bzr case.
-- Iain Lane <laney@ubuntu.com> Tue, 22 Dec 2009 22:26:07 +0000
ubuntu-dev-tools (0.85) lucid; urgency=low

View File

@ -52,15 +52,14 @@ def gen_debdiff(changelog):
oldver = changelog._blocks[1].version
newver = changelog._blocks[0].version
try:
(fd, debdiff) = mkstemp()
os.close(fd)
if os.system('bzr diff -r tag:%s > /dev/null 2>&1' % oldver) == 256:
print "Extracting bzr diff between %s and %s" % (oldver, newver)
(fd, debdiff) = mkstemp()
os.close(fd)
cmd = 'bzr diff -r tag:%s | filterdiff -x "*changelog*" > %s' % (oldver, debdiff)
run_cmd(cmd)
except:
os.unlink(debdiff)
else:
if oldver.epoch is not None:
oldver = str(oldver)[str(oldver).index(":")+1:]
if newver.epoch is not None:
@ -73,8 +72,6 @@ def gen_debdiff(changelog):
check_file(newdsc)
print "Generating debdiff between %s and %s" % (oldver, newver)
(fd, debdiff) = mkstemp()
os.close(fd)
cmd = 'debdiff %s %s | filterdiff -x "*changelog*" > %s' % (olddsc, newdsc, debdiff)
run_cmd(cmd)