diff options
author | 2013-07-10 09:43:36 +0200 | |
---|---|---|
committer | 2013-07-10 09:43:36 +0200 | |
commit | 55bc34b075c0f5197f86a496d8081c12880658b8 (patch) | |
tree | 7f051d5020cff8efb8bd19c02d45817eaae61dba | |
parent | djeuscan: small scan fixes (diff) | |
download | euscan-55bc34b075c0f5197f86a496d8081c12880658b8.tar.gz euscan-55bc34b075c0f5197f86a496d8081c12880658b8.tar.bz2 euscan-55bc34b075c0f5197f86a496d8081c12880658b8.zip |
fixes
-rw-r--r-- | euscanwww/djeuscan/processing/scan/scan_metadata.py | 20 | ||||
-rw-r--r-- | euscanwww/djeuscan/processing/scan/scan_portage.py | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/euscanwww/djeuscan/processing/scan/scan_metadata.py b/euscanwww/djeuscan/processing/scan/scan_metadata.py index 97a2b70..e817f0b 100644 --- a/euscanwww/djeuscan/processing/scan/scan_metadata.py +++ b/euscanwww/djeuscan/processing/scan/scan_metadata.py @@ -135,8 +135,14 @@ class ScanMetadata(object): pkg.herds.add(herd) for maintainer in pkg.maintainers.all(): - if maintainer.email in old_maintainers: + email = maintainer.email + if email in old_maintainers: pkg.maintainers.remove(maintainer) + if (email in maintainers and + email == maintainer.name and + maintainers[email].name != maintainer.name): + maintainer.name = maintainers[email].name + maintainer.save() for maintainer in new_maintainers: maintainer = maintainers[maintainer] @@ -215,9 +221,15 @@ class ScanMetadata(object): maintainer_name = maintainer_node.findtext('name') maintainer_email = maintainer_node.findtext('email') - maintainer = self.store_maintainer( - maintainer_name, maintainer_email - ) + try: + maintainer = self.store_maintainer( + maintainer_name, maintainer_email + ) + except ValidationError: + self.logger.error( + self.style.ERROR("Bad maintainer: '%s' '%s'" % \ + (maintainer_name, maintainer_email)) + ) herd.maintainers.add(maintainer) diff --git a/euscanwww/djeuscan/processing/scan/scan_portage.py b/euscanwww/djeuscan/processing/scan/scan_portage.py index 84b9966..857fce2 100644 --- a/euscanwww/djeuscan/processing/scan/scan_portage.py +++ b/euscanwww/djeuscan/processing/scan/scan_portage.py @@ -386,7 +386,7 @@ def populate_overlays(logger): if not overlay: continue obj, created = Overlay.objects.get_or_create(name=overlay) - if overlay in info: + if overlay in info and type(info[overlay]) == dict: obj.description = info[overlay]["description"] obj.homepage = info[overlay]["homepage"] obj.overlay_path = os.path.join(l.config['storage'], overlay) |