aboutsummaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
Diffstat (limited to 'gbp')
-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)