diff options
author | 2012-08-15 15:34:15 +0200 | |
---|---|---|
committer | 2012-08-15 15:34:15 +0200 | |
commit | 2557b74beb531141de09d0588fdbc73447db7502 (patch) | |
tree | 947735e545506e8ba0be763a9217acf406d9b405 /pym | |
parent | euscanwww: Fixing all templates to be XHTML compliant (diff) | |
parent | euscan: fix mangling (diff) | |
download | euscan-2557b74beb531141de09d0588fdbc73447db7502.tar.gz euscan-2557b74beb531141de09d0588fdbc73447db7502.tar.bz2 euscan-2557b74beb531141de09d0588fdbc73447db7502.zip |
Merge branch 'master' of https://github.com/iksaif/euscan
Diffstat (limited to 'pym')
-rw-r--r-- | pym/euscan/handlers/berlios.py | 2 | ||||
-rw-r--r-- | pym/euscan/handlers/google_code.py | 4 | ||||
-rw-r--r-- | pym/euscan/handlers/sourceforge.py | 8 | ||||
-rw-r--r-- | pym/euscan/mangling.py | 2 | ||||
-rw-r--r-- | pym/euscan/scan.py | 12 |
5 files changed, 15 insertions, 13 deletions
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/mangling.py b/pym/euscan/mangling.py index 203eb21..74fe415 100644 --- a/pym/euscan/mangling.py +++ b/pym/euscan/mangling.py @@ -31,7 +31,7 @@ def apply_mangling_rules(kind, rules, string): ret = None # First try handlers rules - if rule == 'gentoo' and kind == 'version': + if rule == 'gentoo' and kind == 'versionmangle': ret = gentoo_mangle_version(string) elif kind == 'downloadurlmangle': ret = euscan.handlers.mangle_url(rule, string) diff --git a/pym/euscan/scan.py b/pym/euscan/scan.py index 5fb0540..c2297b2 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] == "->": uris.pop() # operator @@ -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) |