From 76a1121c9f34a264b6dfe70be92e1eef52c4a8c9 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Wed, 28 Mar 2012 09:08:22 +0200 Subject: [PATCH] euscan: don't keep version from partial paths Signed-off-by: Corentin Chary --- pym/euscan/handlers/generic.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pym/euscan/handlers/generic.py b/pym/euscan/handlers/generic.py index a2c7faf..400118b 100644 --- a/pym/euscan/handlers/generic.py +++ b/pym/euscan/handlers/generic.py @@ -40,7 +40,7 @@ def scan_ftp(data, url, pattern): 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: return [] @@ -81,10 +81,11 @@ def scan_directory_recursive(cp, ver, rev, url, steps): else: path = url + path - versions.append((path, version)) + if not steps and path not in orig_url: + versions.append((path, version)) 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) return versions @@ -117,7 +118,7 @@ def scan(cpv, url): euscan.output.einfo("Scanning: %s" % 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): cp, ver, rev = portage.pkgsplit(cpv)