Skip to content

Commit cab8164

Browse files
committed
remove useless grep in quiet refresh
In commit da77c23, getuto "made quiet mode more quiet". It did this by piping the output of some gpg calls to a grep pipe, that filtered out any "expected warnings" in the form of no user IDs emitted by keys.openpgp.org, while mostly leaning on gpg --quiet to be quiet. In commit 15fcac9, getuto added -q to grep, with the note "Also, use grep -q to honour --quiet". This meant that grep was instructed to emit zero output if at all possible, and is intended to use for scripts that want to check the return code of grep to see whether matches were found. (getuto does NOT check this.) Given this is incorrect use of grep, we instead just redirect all stdout and stderr to /dev/null. It is semantically identical to what we already do, but with one less fork+exec and the intent is far clearer.
1 parent c2e7945 commit cab8164

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

getuto

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ getuto_refresh() {
8383
else
8484
[[ -n ${QUIET} ]] || einfo "gnupg keyring for package signatures already up-to-date."
8585
fi
86-
87-
# If we got here, everything is fine. Empty a silly string to keep the grep happy
88-
# on the output of getuto_refresh.
89-
[[ -n ${QUIET} ]] && echo OK || true
9086
}
9187

9288

@@ -196,7 +192,7 @@ else
196192
export LC_ALL=C.UTF8
197193

198194
if [[ -n ${QUIET} ]] ; then
199-
getuto_refresh |& grep -qv ": no user ID"
195+
getuto_refresh >/dev/null 2>&1
200196
else
201197
getuto_refresh
202198
fi

0 commit comments

Comments
 (0)