uscan: Drop pre 2.11 devscripts compat code
authorGuido Günther <agx@sigxcpu.org>
Sat, 28 May 2022 07:55:20 +0000 (09:55 +0200)
committerGuido Günther <agx@sigxcpu.org>
Sat, 28 May 2022 09:28:47 +0000 (11:28 +0200)
It's not even in oldoldoldstable anymore

gbp/deb/uscan.py

index 1757ddb3bdabaf59572a18957d4ddd01c078c993..d68053043171fb9ce01961900bffa44188eb7adf 100644 (file)
@@ -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):