From bbfcc3d6d51962849e007872b9672bb42faa04a2 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Wed, 15 Aug 2012 11:04:29 +0200 Subject: euscan: misc fixes Signed-off-by: Corentin Chary --- pym/euscan/handlers/berlios.py | 2 +- pym/euscan/handlers/google_code.py | 4 ++-- pym/euscan/handlers/sourceforge.py | 8 ++++---- pym/euscan/scan.py | 12 +++++++----- 4 files changed, 14 insertions(+), 12 deletions(-) (limited to 'pym') diff --git a/pym/euscan/handlers/berlios.py b/pym/euscan/handlers/berlios.py index 9f716de..bbfe6e1 100644 --- a/pym/euscan/handlers/berlios.py +++ b/pym/euscan/handlers/berlios.py @@ -12,7 +12,7 @@ CONFIDENCE = 90 PRIORITY = 90 -berlios_regex = r"berlios.de/([^/]+)/([^/]+)" +berlios_regex = r"mirror://berlios/([^/]+)/([^/]+)" def can_handle(pkg, url=None): diff --git a/pym/euscan/handlers/google_code.py b/pym/euscan/handlers/google_code.py index a5cb037..892064f 100644 --- a/pym/euscan/handlers/google_code.py +++ b/pym/euscan/handlers/google_code.py @@ -32,6 +32,6 @@ def scan_url(pkg, url, options): result = url_scan(pkg, base_url, file_pattern) ret = [] - for found_url, pv, _, _ in result: - ret.append((found_url, pv, HANDLER_NAME, CONFIDENCE)) + for url, pv, _, _ in result: + ret.append((url, pv, HANDLER_NAME, CONFIDENCE)) return ret diff --git a/pym/euscan/handlers/sourceforge.py b/pym/euscan/handlers/sourceforge.py index df80863..752dba9 100644 --- a/pym/euscan/handlers/sourceforge.py +++ b/pym/euscan/handlers/sourceforge.py @@ -12,7 +12,7 @@ PRIORITY = 90 def can_handle(pkg, url=None): - return url and "sourceforge.net/" in url + return url and "mirror://sourceforge/" in url def scan_url(pkg, url, options): @@ -20,7 +20,7 @@ def scan_url(pkg, url, options): cp, ver, rev = portage.pkgsplit(pkg.cpv) - project, filename = re.search("sourceforge.net/([^/]+)/(?:.*/)?([^/]+)", + project, filename = re.search("mirror://sourceforge/([^/]+)/(?:.*/)?([^/]+)", url).groups() base_url = "http://qa.debian.org/watch/sf.php/%s" % project file_pattern = regex_from_template( @@ -30,6 +30,6 @@ def scan_url(pkg, url, options): result = url_scan(pkg, base_url, file_pattern) ret = [] - for found_url, pv, _, _ in result: - ret.append((found_url, pv, HANDLER_NAME, CONFIDENCE)) + for url, pv, _, _ in result: + ret.append((url, pv, HANDLER_NAME, CONFIDENCE)) return ret diff --git a/pym/euscan/scan.py b/pym/euscan/scan.py index dc7df75..1fc13bb 100644 --- a/pym/euscan/scan.py +++ b/pym/euscan/scan.py @@ -54,8 +54,6 @@ def parse_src_uri(uris): if '://' not in uri: continue - if 'mirror://' in uri: - uri = from_mirror(uri) if uris and uris[-1] == "->": operator = uris.pop() @@ -102,7 +100,7 @@ def scan_upstream(query, on_progress=None): else: matches = Query(query).find( include_masked=True, - in_installed=False + in_installed=False, ) if not matches: @@ -165,9 +163,13 @@ def scan_upstream(query, on_progress=None): uris = pkg.environment('SRC_URI') cpv = pkg.cpv - urls = parse_src_uri(uris) - versions = handlers.scan(pkg, urls, on_progress) + uris = parse_src_uri(uris) + uris_expanded = [ from_mirror(uri) if 'mirror://' in uri else uri for uri in uris ] + pkg._uris = uris + pkg._uris_expanded = uris_expanded + + versions = handlers.scan(pkg, uris, on_progress) cp, ver, rev = portage.pkgsplit(pkg.cpv) -- cgit v1.2.3-65-gdbad