From 561286dba7866449762b5c78f39ed9ffa6ac867a Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 31 Jul 2017 18:09:46 -0300 Subject: Revert "uscan: Always raise an error if we find or " uscan as of devscripts 2.17.7 properly exits on gpg signature validation errors. This reverts commit 0388f9e397e591cd4de7de019e54d10548049943. --- debian/control | 2 +- gbp/deb/uscan.py | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/debian/control b/debian/control index fd7d621c..c66d6177 100644 --- a/debian/control +++ b/debian/control @@ -26,7 +26,7 @@ Build-Depends: # For the testsuite bzip2, cpio, - devscripts (>= 2.13.8~), + devscripts (>= 2.17.7~), git (>= 1:1.7.9.1-1~), pristine-tar, rpm, diff --git a/gbp/deb/uscan.py b/gbp/deb/uscan.py index bd742c79..4613b960 100644 --- a/gbp/deb/uscan.py +++ b/gbp/deb/uscan.py @@ -129,7 +129,7 @@ class Uscan(object): else: self._uptodate = False - def _maybe_raise_error(self, out): + def _raise_error(self, out): r""" Parse the uscan output for errors and warnings and raise a L{UscanError} exception based on this. If no error detail @@ -140,7 +140,7 @@ class Uscan(object): @raises UscanError: exception raised >>> u = Uscan('http://example.com/') - >>> u._maybe_raise_error("uscan warning: " + >>> u._raise_error("uscan warning: " ... "In watchfile debian/watch, reading webpage\n" ... "http://a.b/ failed: 500 Cant connect " ... "to example.com:80 (Bad hostname)") @@ -148,16 +148,15 @@ class Uscan(object): ... UscanError: Uscan failed: uscan warning: In watchfile debian/watch, reading webpage http://a.b/ failed: 500 Cant connect to example.com:80 (Bad hostname) - >>> u._maybe_raise_error("uscan: Can't use --verbose if " + >>> u._raise_error("uscan: Can't use --verbose if " ... "you're using --dehs!") Traceback (most recent call last): ... UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs! - >>> u._maybe_raise_error("OpenPGP signature did not verify.") + >>> u = u._raise_error('') Traceback (most recent call last): ... - UscanError: Uscan failed: OpenPGP signature did not verify. - >>> u._maybe_raise_error('doesnotmatter') + UscanError: Uscan failed - debug by running 'uscan --verbose' """ msg = None @@ -166,8 +165,10 @@ class Uscan(object): if m: msg = "Uscan failed: %s" % m.group(1) break - if msg: - raise UscanError(msg) + + if not msg: + msg = "Uscan failed - debug by running 'uscan --verbose'" + raise UscanError(msg) def scan(self, destdir='..'): """Invoke uscan to fetch a new upstream version""" @@ -180,9 +181,9 @@ class Uscan(object): # Don't fail in the uptodate case: self._parse_uptodate(out) if not self.uptodate: - self._maybe_raise_error(out) if p.returncode: - raise UscanError("Uscan failed - debug by running 'uscan --verbose'") - self._parse(out) + self._raise_error(out) + else: + self._parse(out) # vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: -- cgit v1.2.3