PristineTar: Don't fail if pristine-tar does't support signatures
authorGuido Günther <agx@sigxcpu.org>
Sat, 24 Nov 2018 18:22:34 +0000 (19:22 +0100)
committerGuido Günther <agx@sigxcpu.org>
Sat, 24 Nov 2018 18:46:00 +0000 (19:46 +0100)
gbp/pkg/pristinetar.py
tests/doctests/test_PristineTar.py

index 3cadf482cb842e5bc6fa1c70e0fbddf02ca8df1d..5c0892b754e3f001dbcfc3e246165dce3d637e74 100644 (file)
@@ -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)
 
index 825ef04289582dade667249d092723e828a7155f..15c614cf42be8d946e04b1a29aa341592ae36a36 100644 (file)
@@ -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
     """