PristienTar: Properly detect signature feature
authorGuido Günther <agx@sigxcpu.org>
Sat, 24 Nov 2018 18:22:14 +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

index 76f1d3c854cc254b9da6d8e0f1e92e1c484e1566..3cadf482cb842e5bc6fa1c70e0fbddf02ca8df1d 100644 (file)
@@ -32,7 +32,7 @@ class PristineTar(Command):
                                           cwd=repo.path,
                                           capture_stderr=True)
 
-    def _has_in_output(self, feature):
+    def _has_in_output(self, match):
         """
         Check if pristine_tar has a certain feature enabled.
 
@@ -42,7 +42,7 @@ class PristineTar(Command):
         @rtype: C{bool}
         """
         self.call(['--help'], quiet=True)  # There's no --help so we always exit 1
-        r = re.compile('.* pristine-tar .* %s' % feature)
+        r = re.compile(match)
         for line in self.stderr.splitlines():
             if r.match(line):
                 return True
@@ -50,11 +50,11 @@ class PristineTar(Command):
 
     def has_feature_verify(self):
         """Does this pristine-tar support tarball verification"""
-        return self._has_in_output("verify")
+        return self._has_in_output(".* pristine-tar .* verify")
 
     def has_feature_sig(self):
         """Does this pristine-tar support detached upstream signatures"""
-        return self._has_in_output(r'\[-s signaturefile\]')
+        return self._has_in_output(r'.*--signature-file')
 
     def has_commit(self, archive_regexp):
         """