Commit 160f5bec authored by Daan De Meyer's avatar Daan De Meyer Committed by Allan McRae
Browse files

pacman-key: Add --quiet to a few more gpg invocations



Currently, when running pacman-key --populate, gpg prints the
trustdb check output once for each locally signed and revoked key.
When bootstrapping a new container image, about 50 keys get signed
and revoked which leads to a huge amount of output when running
pacman-key which is repeated 50x.

To avoid overloading the user with gpg output, we add --quiet to the gpg
calls generating the trustdb checking output to silence those calls which
gets rid of the trustdb check output on the terminal.

Signed-off-by: Daan De Meyer's avatarDaan De Meyer <daan.j.demeyer@gmail.com>
Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
parent 5da4af2b
...@@ -192,7 +192,7 @@ check_keyids_exist() { ...@@ -192,7 +192,7 @@ check_keyids_exist() {
} }
key_is_lsigned() { key_is_lsigned() {
secret_key=$("${GPG_PACMAN[@]}" --with-colons --list-secret-key | awk -F : 'NR==1 {print $5}') secret_key=$("${GPG_PACMAN[@]}" --with-colons --list-secret-key --quiet | awk -F : 'NR==1 {print $5}')
while IFS=: read -r type valid _ _ sign_key _; do while IFS=: read -r type valid _ _ sign_key _; do
if [[ $type != "sig" || $valid != "!" ]]; then if [[ $type != "sig" || $valid != "!" ]]; then
continue continue
...@@ -200,7 +200,7 @@ key_is_lsigned() { ...@@ -200,7 +200,7 @@ key_is_lsigned() {
if [[ "$sign_key" == "$secret_key" ]]; then if [[ "$sign_key" == "$secret_key" ]]; then
return 0 return 0
fi fi
done < <("${GPG_PACMAN[@]}" --with-colons --check-signatures "$1") done < <("${GPG_PACMAN[@]}" --with-colons --check-signatures --quiet "$1")
return 1 return 1
} }
...@@ -212,7 +212,7 @@ key_is_revoked() { ...@@ -212,7 +212,7 @@ key_is_revoked() {
if [[ $flags == *"D"* ]]; then if [[ $flags == *"D"* ]]; then
return 0 return 0
fi fi
done < <("${GPG_PACMAN[@]}" --with-colons --list-key "$1") done < <("${GPG_PACMAN[@]}" --with-colons --list-key --quiet "$1")
return 1 return 1
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment