aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-11-03 09:19:55 +0100
committerGuido Günther <agx@sigxcpu.org>2017-11-08 21:13:58 +0100
commit1b5a344581e964434bb9b6918a166d2eb38059f4 (patch)
tree15eb0e91f9f703bda79f5039ece710fe5afe237f /gbp/scripts
parentcb122dd205eeaa01f52fc862d53648a1d3196beb (diff)
buildpackage: Add back --git-pristine-tar-commit support
The call got lost when we split out export-orig. Closes: #880624
Diffstat (limited to 'gbp/scripts')
-rwxr-xr-xgbp/scripts/buildpackage.py13
-rwxr-xr-xgbp/scripts/export_orig.py16
2 files changed, 16 insertions, 13 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 78d32941..47aa63ba 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -46,19 +46,6 @@ from gbp.scripts.export_orig import prepare_upstream_tarballs
from gbp.scripts.tag import perform_tagging
-def pristine_tar_commit(repo, source, options, output_dir, orig_file, upstream_tree):
- if repo.pristine_tar.has_commit(source.name,
- source.upstream_version,
- options.comp_type):
- gbp.log.debug("%s already on pristine tar branch" %
- orig_file)
- else:
- archive = os.path.join(output_dir, orig_file)
- gbp.log.debug("Adding %s to pristine-tar branch" %
- archive)
- repo.pristine_tar.commit(archive, upstream_tree)
-
-
# Functions to handle export-dir
def maybe_write_tree(repo, options):
"""
diff --git a/gbp/scripts/export_orig.py b/gbp/scripts/export_orig.py
index 03152a5c..1e26d7d9 100755
--- a/gbp/scripts/export_orig.py
+++ b/gbp/scripts/export_orig.py
@@ -64,6 +64,7 @@ def prepare_upstream_tarballs(repo, source, options, tarball_dir, output_dir):
if not du.DebianPkgPolicy.has_origs(orig_files, output_dir) or options.force_create:
if not pristine_tar_build_origs(repo, source, output_dir, options):
git_archive_build_origs(repo, source, output_dir, options)
+ maybe_pristine_tar_commit(repo, source, options, output_dir, orig_files)
pristine_tar_verify_origs(repo, source, options, output_dir, orig_files)
@@ -145,6 +146,21 @@ def pristine_tar_verify_origs(repo, source, options, output_dir, orig_files):
return True
+def maybe_pristine_tar_commit(repo, source, options, output_dir, orig_files):
+ if not (hasattr(options, 'pristine_tar_commit') and options.pristine_tar_commit):
+ return
+
+ if repo.pristine_tar.has_commit(source.name,
+ source.upstream_version,
+ options.comp_type):
+ gbp.log.debug("%s already on pristine tar branch" % orig_files[0])
+ else:
+ upstream_tree = git_archive_get_upstream_tree(repo, source, options)
+ archive = os.path.join(output_dir, orig_files[0])
+ gbp.log.debug("Adding %s to pristine-tar branch" % archive)
+ repo.pristine_tar.commit(archive, upstream_tree)
+
+
def git_archive_get_upstream_tree(repo, source, options):
"""
Determine the upstream tree from the given options