diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2017-01-22 12:39:41 +0100 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2017-01-22 13:00:20 +0100 |
commit | 793722996da7f8c9120c678b16350363d30c6bf1 (patch) | |
tree | 5cc96d1512ce19b52620c00d4d95af004c5158a9 /backend | |
parent | sync: Fix pkg sync for packages that have a same named pkg in another category (diff) | |
download | grumpy-793722996da7f8c9120c678b16350363d30c6bf1.tar.gz grumpy-793722996da7f8c9120c678b16350363d30c6bf1.tar.bz2 grumpy-793722996da7f8c9120c678b16350363d30c6bf1.zip |
sync: use assert for GLEP67 compliance check
Should never be raised actually but who knows.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/lib/sync.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/lib/sync.py b/backend/lib/sync.py index 7c499b5..ba31477 100644 --- a/backend/lib/sync.py +++ b/backend/lib/sync.py @@ -175,15 +175,17 @@ def sync_versions(): maintainers = [] if 'maintainers' in pkg: for maint in pkg['maintainers']: - if 'email' not in maint: - print("WARNING: Package %s was told to have a maintainer without an e-mail identifier" % package.full_name) - continue + assert ( + 'email' in maint and 'type' in maint, + "Package %s maintainer %s entry not GLEP 67 valid" % (package.full_name, maint) + ) + email = maint['email'].lower() if email in existing_maintainers: maintainers.append(existing_maintainers[email]) else: is_project = False - if 'type' in maint and maint['type'] == 'project': + if maint['type'] == 'project': is_project = True print("Adding %s maintainer %s" % ("project" if is_project else "individual", email)) new_maintainer = Maintainer(email=email, is_project=is_project, name=maint['name'] if 'name' in maint else None) |