diff options
author | Guido Günther <agx@sigxcpu.org> | 2022-05-28 09:55:20 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2022-05-28 11:28:47 +0200 |
commit | 36737d22f50accf818e7ee0461d30a63bd350046 (patch) | |
tree | 66788ed00e53c6d8487f3d9f7e2089544c177970 | |
parent | 05ea122f530c0654d8deb0f878badc8bd4cdf58a (diff) |
uscan: Drop pre 2.11 devscripts compat code
It's not even in oldoldoldstable anymore
-rw-r--r-- | gbp/deb/uscan.py | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/gbp/deb/uscan.py b/gbp/deb/uscan.py index 1757ddb3..d6805304 100644 --- a/gbp/deb/uscan.py +++ b/gbp/deb/uscan.py @@ -43,7 +43,7 @@ class Uscan(object): def _parse(self, out): r""" - Parse the uscan output return and update the object's properties + Parse the uscan output and update the object's properties @param out: uscan output @type out: string @@ -57,44 +57,17 @@ class Uscan(object): >>> u._parse('') Traceback (most recent call last): ... - gbp.deb.uscan.UscanError: Couldn't find 'upstream-url' in uscan output + gbp.deb.uscan.UscanError: Couldn't find source in uscan output """ source = None self._uptodate = False - # Check if uscan downloaded something for row in out.split("\n"): - # uscan >= 2.10.70 has a target element: m = re.match(r"<target>(.*)</target>", row) if m: source = '../%s' % m.group(1) - break - # Try to determine the already downloaded sources name - else: - d = {} - - try: - for row in out.split("\n"): - for n in ('package', - 'upstream-version', - 'upstream-url'): - m = re.match("<%s>(.*)</%s>" % (n, n), row) - if m: - d[n] = m.group(1) - d["ext"] = os.path.splitext(d['upstream-url'])[1] - # We want the name of the orig tarball if possible - source = ("../%(package)s_%(upstream-version)s." - "orig.tar%(ext)s" % d) - - # Fall back to the upstream source name otherwise - if not os.path.exists(source): - source = "../%s" % d['upstream-url'].rsplit('/', 1)[1] - if not os.path.exists(source): - raise UscanError("Couldn't find tarball at '%s'" % - source) - except KeyError as e: - raise UscanError("Couldn't find '%s' in uscan output" % - e.args[0]) + if not source: + raise UscanError("Couldn't find source in uscan output") self._tarball = source def _parse_uptodate(self, out): |