aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-11-24 19:22:34 +0100
committerGuido Günther <agx@sigxcpu.org>2018-11-24 19:46:00 +0100
commit0277c5477fd86ef1871b7b6cf04bc84192a0330d (patch)
treebb167ebac4d8b9d06461f3a17adce87392d8cf67
parentad904b89f001bf3c6b4548916b5e27399b9d6a5d (diff)
PristineTar: Don't fail if pristine-tar does't support signatures
-rw-r--r--gbp/pkg/pristinetar.py4
-rw-r--r--tests/doctests/test_PristineTar.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/gbp/pkg/pristinetar.py b/gbp/pkg/pristinetar.py
index 3cadf48..5c0892b 100644
--- a/gbp/pkg/pristinetar.py
+++ b/gbp/pkg/pristinetar.py
@@ -92,7 +92,7 @@ class PristineTar(Command):
"""
args = ['checkout', archive]
self.run_error = 'Pristine-tar couldn\'t checkout "%s": {stderr_or_reason}' % os.path.basename(archive)
- if signaturefile:
+ if signaturefile and self.has_feature_sig():
args += ['-s', signaturefile]
self.__call__(args, quiet=quiet)
@@ -109,7 +109,7 @@ class PristineTar(Command):
args = ['commit', archive, upstream]
self.run_error = ("Couldn't commit to '%s' with upstream '%s': {stderr_or_reason}" %
(self.branch, upstream))
- if signaturefile:
+ if signaturefile and self.has_feature_sig():
args += ['-s', signaturefile]
self.__call__(args, quiet=quiet)
diff --git a/tests/doctests/test_PristineTar.py b/tests/doctests/test_PristineTar.py
index 825ef04..15c614c 100644
--- a/tests/doctests/test_PristineTar.py
+++ b/tests/doctests/test_PristineTar.py
@@ -169,7 +169,7 @@ def test_pristine_tar_checkout_with_sig():
>>> os.unlink(sf)
>>> repo.pristine_tar.checkout('upstream', '1.0', 'gzip', '..',
... signature=True)
- >>> os.path.exists(sf)
+ >>> os.path.exists(sf) or not repo.pristine_tar.has_feature_sig()
True
"""