aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2012-08-15 11:04:29 +0200
committerCorentin Chary <corentin.chary@gmail.com>2012-08-15 11:04:29 +0200
commitbbfcc3d6d51962849e007872b9672bb42faa04a2 (patch)
treee938ced7c525e3b77f497b98c0d2f9f08fdc221e /pym
parentdjeuscan: enhance email template (diff)
downloadeuscan-bbfcc3d6d51962849e007872b9672bb42faa04a2.tar.gz
euscan-bbfcc3d6d51962849e007872b9672bb42faa04a2.tar.bz2
euscan-bbfcc3d6d51962849e007872b9672bb42faa04a2.zip
euscan: misc fixes
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Diffstat (limited to 'pym')
-rw-r--r--pym/euscan/handlers/berlios.py2
-rw-r--r--pym/euscan/handlers/google_code.py4
-rw-r--r--pym/euscan/handlers/sourceforge.py8
-rw-r--r--pym/euscan/scan.py12
4 files changed, 14 insertions, 12 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/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)