summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-01-25 20:59:42 +0100
committerGuido Günther <agx@sigxcpu.org>2010-01-25 21:10:53 +0100
commit237a5470d98b15289f4167f03a2d14a94831eb57 (patch)
tree5c6214fbc79c9487bae0b1cba3e1d2edf5bce2f0
parentea6311eed38688ce0a2aac0f6b1c041ba6ef6923 (diff)
downloadgit-buildpackage-237a5470d98b15289f4167f03a2d14a94831eb57.tar.gz
git-buildpackage-237a5470d98b15289f4167f03a2d14a94831eb57.tar.bz2
git-buildpackage-237a5470d98b15289f4167f03a2d14a94831eb57.zip
Import version 3 source format
Closes: #552771
-rwxr-xr-xgit-import-dsc20
1 files changed, 16 insertions, 4 deletions
diff --git a/git-import-dsc b/git-import-dsc
index f47dcb77..3c3becb6 100755
--- a/git-import-dsc
+++ b/git-import-dsc
@@ -50,15 +50,27 @@ def git_apply_patch(diff):
return True
+def apply_deb_tgz(deb_tgz):
+ """Apply .debian.tar.gz (V3 source format)"""
+ unpackArchive = gbpc.UnpackTarArchive(deb_tgz, ".")()
+ gbpc.GitAdd()(["debian/"])
+ return True
+
+
def apply_debian_patch(repo, src, options):
"""apply the debian patch and tag appropriately"""
version = "%s-%s" % (src.upstream_version, src.debian_version)
gitTag = gbpc.GitTag(options.sign_tags, options.keyid)
try:
- if not src.diff:
+ if not src.diff and not src.deb_tgz:
raise GbpError, "No diff to apply."
- if not git_apply_patch(src.diff):
+
+ if src.diff and not git_apply_patch(src.diff):
raise GbpError
+
+ if src.deb_tgz and not apply_deb_tgz(src.deb_tgz):
+ raise GbpError
+
os.chmod('debian/rules', 0755)
if not repo.is_clean()[0]:
dch = parse_changelog('debian/changelog')
@@ -157,7 +169,7 @@ def main(argv):
raise GbpError
else:
src = parse_dsc(args[0])
- if src.pkgformat != '1.0':
+ if src.pkgformat not in [ '1.0', '3.0' ]:
raise GbpError, "Importing %s source format not yet supported." % src.pkgformat
if options.verbose:
print_dsc(src)
@@ -218,7 +230,7 @@ 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)
- if src.diff:
+ if src.diff or src.deb_tgz:
apply_debian_patch(repo, src, options)
else:
print >>sys.stderr, "Warning: Didn't find a diff to apply."