Check for duplicate ids in update-source-catalog.

impish-sru-lp-1946520
Michael Hudson-Doyle 3 years ago
parent 8f8fc220c7
commit 1b87b238ea

1
debian/changelog vendored

@ -1,6 +1,7 @@
livecd-rootfs (2.737) UNRELEASED; urgency=medium
* Generate source catalogs for the desktop canary build.
* Check for duplicate ids in update-source-catalog.
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Mon, 13 Sep 2021 09:52:06 +1200

@ -51,15 +51,19 @@ for mo in glob.glob(os.path.join(opts.translations, '*.mo')):
output.append(template)
default_count = 0
ids = set()
for entry in output:
if entry.get('default', False):
default_count += 1
ids.add(entry['id'])
if default_count > 1:
print("Too many defaults in source catalog!")
sys.exit(1)
if len(ids) != len(output):
print("Non unique ids in %s!" % output)
with open(opts.output, 'w') as fp:
yaml.dump(output, fp)

Loading…
Cancel
Save