2011-12-30 11:34:39 +01:00
|
|
|
from euscan.handlers import generic
|
|
|
|
|
2012-05-23 16:30:43 +02:00
|
|
|
HANDLER_NAME = "kde"
|
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
|
2011-12-30 11:34:39 +01:00
|
|
|
def can_handle(cpv, url):
|
|
|
|
if url.startswith('mirror://kde/'):
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
|
2011-12-30 11:34:39 +01:00
|
|
|
def clean_results(results):
|
|
|
|
ret = []
|
|
|
|
|
2012-05-23 16:44:44 +02:00
|
|
|
for path, version, confidence in results:
|
2011-12-30 11:34:39 +01:00
|
|
|
if version == '5SUMS':
|
|
|
|
continue
|
2012-05-23 16:44:44 +02:00
|
|
|
ret.append((path, version, HANDLER_NAME, confidence))
|
2011-12-30 11:34:39 +01:00
|
|
|
|
|
|
|
return ret
|
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
|
2011-12-30 11:34:39 +01:00
|
|
|
def scan(cpv, url):
|
|
|
|
results = generic.scan(cpv, url)
|
|
|
|
|
|
|
|
if url.startswith('mirror://kde/unstable/'):
|
|
|
|
url = url.replace('mirror://kde/unstable/', 'mirror://kde/stable/')
|
|
|
|
results += generic.scan(cpv, url)
|
|
|
|
|
|
|
|
return clean_results(results)
|
|
|
|
|
2012-04-28 18:16:05 +02:00
|
|
|
|
2011-12-30 11:34:39 +01:00
|
|
|
def brute_force(cpv, url):
|
|
|
|
results = generic.brute_force(cpv, url)
|
|
|
|
|
|
|
|
if url.startswith('mirror://kde/unstable/'):
|
|
|
|
url = url.replace('mirror://kde/unstable/', 'mirror://kde/stable/')
|
|
|
|
results += generic.brute_force(cpv, url)
|
|
|
|
|
|
|
|
return clean_results(results)
|