aboutsummaryrefslogtreecommitdiff
path: root/gbp/scripts/import_dsc.py
diff options
context:
space:
mode:
authorGuido G√ľnther <agx@sigxcpu.org>2016-04-14 08:41:40 +0200
committerGuido G√ľnther <agx@sigxcpu.org>2016-04-14 08:44:11 +0200
commit074e8e6141f5c7d325b20f73b908409e5ba91e1a (patch)
tree9b767f6d2a2d2074024a5029ada567986d032a9d /gbp/scripts/import_dsc.py
parent1d9d26d7675f6e531a953701f53db3ac9d428a46 (diff)
import_dsc: Allow to use pristine-tar with multiple tarballs
Diffstat (limited to 'gbp/scripts/import_dsc.py')
-rw-r--r--gbp/scripts/import_dsc.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index eb42925c..1765d973 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -41,6 +41,19 @@ class SkipImport(Exception):
pass
+def generate_pristine_tarballs(repo, src, upstream_tree):
+ subdirs = src.additional_tarballs.keys()
+ main_tree = repo.tree_drop_dirs(upstream_tree, subdirs)
+
+ for dir, tarball in src.additional_tarballs.items():
+ subtree = repo.tree_get_dir(upstream_tree, dir)
+ if not subtree:
+ raise GbpError("No tree for '%s' found in '%s' to create pristine tar commit from" % (dir, upstream_tree))
+ gbp.log.debug("Creating pristine tar commit '%s' from '%s'" % (dir, subtree))
+ repo.pristine_tar.commit(tarball, subtree)
+ repo.pristine_tar.commit(src.tgz, main_tree)
+
+
def download_source(pkg, dirs, unauth):
opts = [ '--download-only' ]
if unauth:
@@ -328,8 +341,6 @@ def main(argv):
if repo.bare:
disable_pristine_tar(options, "Bare repository")
- elif src.additional_tarballs:
- disable_pristine_tar(options, "Component tarballs found")
dirs['tmp'] = os.path.abspath(tempfile.mkdtemp(dir='..'))
upstream = DebianUpstreamSource(src.tgz)
@@ -389,7 +400,7 @@ def main(argv):
if is_empty:
repo.create_branch(options.upstream_branch, commit)
if options.pristine_tar:
- repo.pristine_tar.commit(src.tgz, options.upstream_branch)
+ generate_pristine_tarballs(repo, src, options.upstream_branch)
if (not repo.has_branch(options.debian_branch)
and (is_empty or options.create_missing_branches)):
repo.create_branch(options.debian_branch, commit)