Merge branch 'master' of https://github.com/iksaif/euscan
This commit is contained in:
@ -12,7 +12,7 @@ CONFIDENCE = 90
|
||||
PRIORITY = 90
|
||||
|
||||
|
||||
berlios_regex = r"berlios.de/([^/]+)/([^/]+)"
|
||||
berlios_regex = r"mirror://berlios/([^/]+)/([^/]+)"
|
||||
|
||||
|
||||
def can_handle(pkg, url=None):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user