euscan/handlers: we need the file version

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-10-29 13:05:20 +01:00
parent 90c7f27b95
commit df1da16e45
3 changed files with 23 additions and 3 deletions

View File

@ -16,7 +16,14 @@ berlios_regex = r"mirror://berlios/([^/]+)/([^/]+)"
def can_handle(pkg, url=None): def can_handle(pkg, url=None):
return url and re.search(berlios_regex, url) if not url:
return False
cp, ver, rev = portage.pkgsplit(pkg.cpv)
if ver not in url:
return False
return re.search(berlios_regex, url)
def scan_url(pkg, url, options): def scan_url(pkg, url, options):

View File

@ -14,8 +14,14 @@ package_name_regex = r"http://(.+).googlecode.com/files/.+"
def can_handle(pkg, url=None): def can_handle(pkg, url=None):
return url and re.match(package_name_regex, url) if not url:
return False
cp, ver, rev = portage.pkgsplit(pkg.cpv)
if ver not in url:
return False
return re.match(package_name_regex, url)
def scan_url(pkg, url, options): def scan_url(pkg, url, options):
output.einfo("Using Google Code handler") output.einfo("Using Google Code handler")

View File

@ -12,7 +12,14 @@ PRIORITY = 90
def can_handle(pkg, url=None): def can_handle(pkg, url=None):
return url and "mirror://sourceforge/" in url if not url:
return False
cp, ver, rev = portage.pkgsplit(pkg.cpv)
if ver not in url:
return False
return "mirror://sourceforge/" in url
def scan_url(pkg, url, options): def scan_url(pkg, url, options):