__apt_key: fix key dearmor when fetching from uri

This commit is contained in:
ander 2019-09-20 12:00:22 +03:00
parent 799ec72369
commit d147f4a86f

View file

@ -48,11 +48,11 @@ curl -s -L \\
-o "$keyfile" \\
"$uri"
if grep -Fq 'BEGIN PGP PUBLIC KEY BLOCK' \\
"$keyfile"
key="\$( cat "$keyfile" )"
if echo "\$key" | grep -Fq 'BEGIN PGP PUBLIC KEY BLOCK'
then
cat "$keyfile" \\
| gpg --export > "$keyfile"
echo "\$key" | gpg --dearmor > "$keyfile"
fi
EOF