apt-config/refresh-obs-keys.sh

30 lines
662 B
Bash
Executable File

#!/bin/bash
set -e
tmpdir=$(mktemp --tmpdir -d refresh-obs-keys-XXXXXXX)
trap 'rm -rf "${tmpdir}"' EXIT
self=`readlink -f "$0"`
basedir=`dirname "${self}"`
keyringdir="${basedir}/trusted.gpg.d"
cd "${tmpdir}"
obs_get() {
local proj="$1"
local target="$2"
echo "Fetching key for ${proj}"
osc signkey --notravers "${proj}" > "public.key"
echo "Converting to keyring"
"${basedir}/create-gpgring.sh" -o "keyring.gpg" -- "public.key"
mv "keyring.gpg" "${target}"
}
obs_get "home:stbuehler" "${keyringdir}/obs-home-stbuehler.gpg"
obs_get "server:http" "${keyringdir}/obs-server-http.gpg"
obs_get "openSUSE:Tools" "${keyringdir}/obs-openSUSE-Tools.gpg"