From 97830775c8b40bb8cbea64fe1482b691ec1a12eb Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Tue, 14 Aug 2012 09:11:23 +0200 Subject: [PATCH] djeuscan: fix some small bugs Signed-off-by: Corentin Chary --- euscanwww/djeuscan/helpers.py | 2 +- euscanwww/djeuscan/processing/scan/scan_metadata.py | 3 +-- euscanwww/djeuscan/tasks.py | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/euscanwww/djeuscan/helpers.py b/euscanwww/djeuscan/helpers.py index e502a2c..3d3ff16 100644 --- a/euscanwww/djeuscan/helpers.py +++ b/euscanwww/djeuscan/helpers.py @@ -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: diff --git a/euscanwww/djeuscan/processing/scan/scan_metadata.py b/euscanwww/djeuscan/processing/scan/scan_metadata.py index 0d9b615..097229f 100644 --- a/euscanwww/djeuscan/processing/scan/scan_metadata.py +++ b/euscanwww/djeuscan/processing/scan/scan_metadata.py @@ -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) diff --git a/euscanwww/djeuscan/tasks.py b/euscanwww/djeuscan/tasks.py index 5ec66ea..c30c744 100644 --- a/euscanwww/djeuscan/tasks.py +++ b/euscanwww/djeuscan/tasks.py @@ -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,