euscan: don't keep version from partial paths

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
Corentin Chary 2012-03-28 09:08:22 +02:00
parent 697fbf06ab
commit 76a1121c9f

View File

@ -40,7 +40,7 @@ def scan_ftp(data, url, pattern):
return results return results
def scan_directory_recursive(cp, ver, rev, url, steps): def scan_directory_recursive(cp, ver, rev, url, steps, orig_url):
if not steps: if not steps:
return [] return []
@ -81,10 +81,11 @@ def scan_directory_recursive(cp, ver, rev, url, steps):
else: else:
path = url + path path = url + path
if not steps and path not in orig_url:
versions.append((path, version)) versions.append((path, version))
if steps: if steps:
ret = scan_directory_recursive(cp, ver, rev, path, steps) ret = scan_directory_recursive(cp, ver, rev, path, steps, orig_url)
versions.extend(ret) versions.extend(ret)
return versions return versions
@ -117,7 +118,7 @@ def scan(cpv, url):
euscan.output.einfo("Scanning: %s" % template) euscan.output.einfo("Scanning: %s" % template)
steps = helpers.generate_scan_paths(template) steps = helpers.generate_scan_paths(template)
return scan_directory_recursive(cp, ver, rev, "", steps) return scan_directory_recursive(cp, ver, rev, "", steps, url)
def brute_force(cpv, url): def brute_force(cpv, url):
cp, ver, rev = portage.pkgsplit(cpv) cp, ver, rev = portage.pkgsplit(cpv)