File: migration

package info (click to toggle)
gnupg2 2.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 48,668 kB
  • sloc: ansic: 287,627; sh: 7,938; lisp: 6,735; makefile: 1,982; awk: 160; xml: 53; python: 16; sed: 16; php: 14; perl: 13
file content (24 lines) | stat: -rwxr-xr-x 616 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e
set -x

DIR=$(mktemp -d)
GPG_HOME="$DIR/gnupg"
gpg_args() {
	gpg=$1; shift
	"$gpg" --homedir "$GPG_HOME" --batch --quiet --with-colons "$@"
}

mkdir "$GPG_HOME"
chmod 700 "$GPG_HOME"

cat $(ls /usr/share/keyrings/debian-archive-*.pgp \
	| grep -vE 'debian-archive-bookworm-stable.pgp|debian-archive-keyring.pgp|debian-archive-trixie-stable.pgp') \
	| gpg_args gpg1 --import
gpg_args gpg1 --list-keys
gpg_args gpg --list-keys > "$DIR/key.list.before"
migrate-pubring-from-classic-gpg "$GPG_HOME"
gpg_args gpg --list-keys > "$DIR/key.list.after"

diff -u "$DIR/key.list.before" "$DIR/key.list.after"