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)