Skip to content

Commit

Permalink
apt-key: add \n to dpkg-query --show --showformat
Browse files Browse the repository at this point in the history
Guarding against 'broken' greps not dealing with non-text inputs
"just in case" by making the input text with a proper newline.

[commit message by David Kalnischkies]

Reported-On: IRC
Git-Dch: Ignore
  • Loading branch information
Carsten Hey authored and DonKult committed May 1, 2016
1 parent 5f17b19 commit 2e49f51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmdline/apt-key.in
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ prepare_gpg_home() {
# well as the script hopefully uses apt-key optionally then like e.g.
# debian-archive-keyring for (upgrade) cleanup did
if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
if ! dpkg-query --show --showformat '${Pre-Depends}${Depends}${Recommends}' "$DPKG_MAINTSCRIPT_PACKAGE" 2>/dev/null | grep -q gnupg; then
if ! dpkg-query --show --showformat '${Pre-Depends}${Depends}${Recommends}\n' "$DPKG_MAINTSCRIPT_PACKAGE" 2>/dev/null | grep -q gnupg; then
cat >&2 <<EOF
Warning: The $DPKG_MAINTSCRIPT_NAME maintainerscript of the package $DPKG_MAINTSCRIPT_PACKAGE
Warning: seems to use apt-key (provided by apt) without depending on gnupg or gnupg2.
Expand Down

0 comments on commit 2e49f51

Please sign in to comment.