2012-02-12 10:04:59 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-02-12 15:42:01 -06:00
|
|
|
export LANG=C
|
|
|
|
|
2012-02-12 10:04:59 -06:00
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
trap "rm -rf '${TMPDIR}'" EXIT
|
|
|
|
|
2012-04-07 11:38:26 -05:00
|
|
|
KEYSERVER='hkp://pool.sks-keyservers.net'
|
2012-02-12 15:42:01 -06:00
|
|
|
GPG="gpg --quiet --batch --no-tty --no-permission-warning --keyserver "${KEYSERVER}" --homedir ${TMPDIR}"
|
2012-02-12 10:04:59 -06:00
|
|
|
|
|
|
|
pushd "$(dirname "$0")" >/dev/null
|
2012-02-12 15:42:01 -06:00
|
|
|
|
|
|
|
$GPG --gen-key <<EOF
|
|
|
|
%echo Generating Arch Linux Keyring keychain master key...
|
|
|
|
Key-Type: RSA
|
2012-03-31 10:40:22 -06:00
|
|
|
Key-Length: 1024
|
2012-02-12 15:42:01 -06:00
|
|
|
Key-Usage: sign
|
|
|
|
Name-Real: Arch Linux Keyring Keychain Master Key
|
|
|
|
Name-Email: archlinux-keyring@localhost
|
|
|
|
Expire-Date: 0
|
|
|
|
%commit
|
|
|
|
%echo Done
|
|
|
|
EOF
|
|
|
|
|
2013-05-25 05:48:49 -05:00
|
|
|
rm -rf master packager packager-revoked archlinux-trusted archlinux-revoked
|
|
|
|
mkdir master packager packager-revoked
|
2012-02-12 15:42:01 -06:00
|
|
|
|
|
|
|
while read -ra data; do
|
|
|
|
keyid="${data[0]}"
|
|
|
|
username="${data[@]:1}"
|
|
|
|
${GPG} --recv-keys ${keyid} &>/dev/null
|
2012-03-03 13:56:03 -06:00
|
|
|
printf 'minimize\nquit\ny\n' | \
|
|
|
|
${GPG} --command-fd 0 --edit-key ${keyid}
|
2012-03-31 10:40:22 -06:00
|
|
|
${GPG} --yes --lsign-key ${keyid} &>/dev/null
|
2013-05-25 05:48:49 -05:00
|
|
|
${GPG} --armor --no-emit-version --output master/${username}.asc --export ${keyid}
|
2012-03-03 11:16:04 -06:00
|
|
|
echo "${keyid}:4:" >> archlinux-trusted
|
2012-02-12 15:42:01 -06:00
|
|
|
done < master-keyids
|
2012-03-31 10:40:22 -06:00
|
|
|
${GPG} --import-ownertrust < archlinux-trusted 2>/dev/null
|
2012-02-12 15:42:01 -06:00
|
|
|
|
|
|
|
while read -ra data; do
|
|
|
|
keyid="${data[0]}"
|
|
|
|
username="${data[@]:1}"
|
|
|
|
${GPG} --recv-keys ${keyid} &>/dev/null
|
2012-03-03 11:16:04 -06:00
|
|
|
printf 'clean\nquit\ny\n' | \
|
|
|
|
${GPG} --command-fd 0 --edit-key ${keyid}
|
2012-02-12 15:42:01 -06:00
|
|
|
FD=$(mktemp)
|
|
|
|
exec 4>"${FD}"
|
|
|
|
if ! ${GPG} --list-keys --with-colons ${keyid} 2>/dev/null | grep -q '^pub:f:'; then
|
|
|
|
echo "key is not fully trusted: ${keyid} ${username}"
|
|
|
|
else
|
2013-05-25 05:48:49 -05:00
|
|
|
${GPG} --armor --no-emit-version --output packager/${username}.asc --export ${keyid}
|
2012-02-12 15:42:01 -06:00
|
|
|
fi
|
|
|
|
done < packager-keyids
|
|
|
|
|
2013-05-25 05:48:49 -05:00
|
|
|
while read -ra data; do
|
|
|
|
keyid="${data[0]}"
|
|
|
|
username="${data[1]}"
|
|
|
|
${GPG} --recv-keys ${keyid} &>/dev/null
|
|
|
|
printf 'clean\nquit\ny\n' | \
|
|
|
|
${GPG} --command-fd 0 --edit-key ${keyid}
|
|
|
|
FD=$(mktemp)
|
|
|
|
exec 4>"${FD}"
|
|
|
|
if ! ${GPG} --list-keys --with-colons ${keyid} 2>/dev/null | grep -q '^pub:f:'; then
|
|
|
|
${GPG} --armor --no-emit-version --output packager-revoked/${username}.asc --export ${keyid}
|
|
|
|
echo "${keyid}" >> archlinux-revoked
|
|
|
|
else
|
|
|
|
echo "key is still fully trusted: ${keyid} ${username}"
|
|
|
|
fi
|
|
|
|
done < packager-revoked-keyids
|
|
|
|
|
|
|
|
cat master/*.asc packager/*.asc packager-revoked/*.asc > archlinux.gpg
|
2012-03-03 11:16:04 -06:00
|
|
|
|
2012-02-12 10:04:59 -06:00
|
|
|
popd >/dev/null
|