aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-12-13 14:09:44 +0100
committerGuido Günther <agx@sigxcpu.org>2009-12-13 15:03:17 +0100
commitdce995dcb2daad2a7db50d26b798aaffc931ad4d (patch)
treebf123b0f10aec92a99368430eaf2578077322718
parent2b039f2fc40084bd47585f3ddb8693c4abf3b48c (diff)
Improve error handling on broken dsc files.
Closes: #560689
-rwxr-xr-xgit-import-dsc12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-import-dsc b/git-import-dsc
index a5a12a6..c88aa95 100755
--- a/git-import-dsc
+++ b/git-import-dsc
@@ -55,7 +55,9 @@ def apply_debian_patch(repo, src, options):
version = "%s-%s" % (src.upstream_version, src.debian_version)
gitTag = gbpc.GitTag(options.sign_tags, options.keyid)
try:
- if src.diff and not git_apply_patch(src.diff):
+ if not src.diff:
+ raise GbpError, "No diff to apply."
+ if not git_apply_patch(src.diff):
raise GbpError
os.chmod('debian/rules', 0755)
if not repo.is_clean()[0]:
@@ -82,9 +84,12 @@ def print_dsc(dsc):
if dsc.native:
print "Debian Native Package"
print "Version:", dsc.upstream_version
+ print "Debian tarball:", dsc.tgz
else:
print "Upstream version:", dsc.upstream_version
print "Debian version:", dsc.debian_version
+ print "Upstream tarball:", dsc.tgz
+ print "Debian diff:", dsc.diff
if dsc.epoch:
print "Epoch: %s" % dsc.epoch
@@ -203,7 +208,10 @@ def main(argv):
except gbpc.CommandExecFailed:
raise GbpError, """Merge of %s failed, please resolve manually""" % options.upstream_branch
repo.replace_tree(unpack_dir, options.filters)
- apply_debian_patch(repo, src, options)
+ if src.diff:
+ apply_debian_patch(repo, src, options)
+ else:
+ print >>sys.stderr, "Warning: Didn't find a diff to apply."
except gbpc.CommandExecFailed:
os.chdir(dirs['top'])
ret = 1