djeuscan: fix some small bugs

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-08-14 09:11:23 +02:00
parent d1058aed8b
commit 97830775c8
3 changed files with 3 additions and 5 deletions

View File

@ -44,7 +44,7 @@ def packages_from_names(data):
data = data.replace("\r", "")
for pkg in data.split('\n'):
if '/' in pkg:
if pkg.count('/') == 1:
cat, pkg = pkg.split('/')
packages.extend(Package.objects.filter(category=cat, name=pkg))
else:

View File

@ -26,7 +26,7 @@ class ScanMetadata(object):
try:
category, package = portage.catsplit(query)
return Package.objects.get(category=package, name=package)
return Package.objects.get(category=category, name=package)
except Package.DoesNotExist:
pass
@ -88,7 +88,6 @@ class ScanMetadata(object):
return pkg, package.metadata
def scan(self, query=None, pkg=None):
try:
metadata = None
pkg, metadata = self.metadata_from_db(query, pkg)

View File

@ -154,8 +154,7 @@ def scan_upstream(packages=[], purge_versions=False):
logger.info("Starting upstream scan subtask for %d packages...",
len(packages))
else:
logger.info("Starting upstream scan...",
len(packages))
logger.info("Starting upstream scan...")
scan.scan_upstream(
packages=packages,