File: no-dupes.t

package info (click to toggle)
debian-keyring 2025.09.18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 106,344 kB
  • sloc: python: 1,266; sh: 888; perl: 261; ruby: 53; makefile: 40
file content (23 lines) | stat: -rwxr-xr-x 535 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# Looks for keys that are duplicated in a keyring
set -e

find_dupes () {
	k=$1
	for key in $(gpg --no-options --no-auto-check-trustdb \
			--no-default-keyring --keyring "./output/keyrings/$k" \
			--list-keys --with-colons | grep '^pub' \
			| cut -d: -f 5 | sort | uniq -c | sort -n \
			| grep -v '      1 ' | sed -e 's/^ .* //'); do
		echo -e "$k:\t0x$key is duplicated"
		fail=1
	done
}

fail=0
for keyring in debian-keyring.pgp debian-maintainers.pgp \
		debian-nonupload.pgp; do
	find_dupes $keyring
done

exit $fail