aboutsummaryrefslogtreecommitdiff
path: root/git-import-dsc
diff options
context:
space:
mode:
Diffstat (limited to 'git-import-dsc')
-rwxr-xr-xgit-import-dsc14
1 files changed, 12 insertions, 2 deletions
diff --git a/git-import-dsc b/git-import-dsc
index a5a12a6..37e6d51 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
@@ -147,6 +152,8 @@ def main(argv):
raise GbpError
else:
src = parse_dsc(args[0])
+ if src.pkgformat != '1.0':
+ raise GbpError, "Importing %s source format not yet supported." % src.pkgformat
if options.verbose:
print_dsc(src)
@@ -203,7 +210,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