From 1b87b238ea7118fc58e82f3428d14cbd144293fe Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 14 Sep 2021 21:29:14 +1200 Subject: [PATCH] Check for duplicate ids in update-source-catalog. --- debian/changelog | 1 + update-source-catalog | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index c568cf9f..2311265e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 13 Sep 2021 09:52:06 +1200 diff --git a/update-source-catalog b/update-source-catalog index 63e53e6d..50aa3a16 100755 --- a/update-source-catalog +++ b/update-source-catalog @@ -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)