aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-07-31 18:09:46 -0300
committerGuido Günther <agx@sigxcpu.org>2017-07-31 18:11:01 -0300
commit561286dba7866449762b5c78f39ed9ffa6ac867a (patch)
tree46df5949e18a72d4817bb92538d55e4cfb707a8d
parent62ab1eb839cd429027a3f84433b6b720122f5d25 (diff)
Revert "uscan: Always raise an error if we find <error/> or <warning/>"
uscan as of devscripts 2.17.7 properly exits on gpg signature validation errors. This reverts commit 0388f9e397e591cd4de7de019e54d10548049943.
-rw-r--r--debian/control2
-rw-r--r--gbp/deb/uscan.py23
2 files changed, 13 insertions, 12 deletions
diff --git a/debian/control b/debian/control
index fd7d621..c66d617 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 bd742c7..4613b96 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("<warnings>uscan warning: "
+ >>> u._raise_error("<warnings>uscan warning: "
... "In watchfile debian/watch, reading webpage\n"
... "http://a.b/ failed: 500 Cant connect "
... "to example.com:80 (Bad hostname)</warnings>")
@@ -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("<errors>uscan: Can't use --verbose if "
+ >>> u._raise_error("<errors>uscan: Can't use --verbose if "
... "you're using --dehs!</errors>")
Traceback (most recent call last):
...
UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
- >>> u._maybe_raise_error("<warnings>OpenPGP signature did not verify.</warnings>")
+ >>> 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\:·: