diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2019-08-05 18:53:09 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-10-07 05:16:07 +0200 |
commit | 45e01e55c96d9abf8c73f6ee3766b16e5fbefc4d (patch) | |
tree | 3468d92ea9c540b8321661835ffb35bc62a52bfe /scripts | |
parent | 6d99a15f0bd9cba4500808114738065903312bf6 (diff) | |
download | pacman-45e01e55c96d9abf8c73f6ee3766b16e5fbefc4d.tar.gz pacman-45e01e55c96d9abf8c73f6ee3766b16e5fbefc4d.tar.xz |
pacman-key: when refreshing gpg.conf, don't truncate option checking
If an option is a two-part option, we print both (separated by IFS=' '),
but when grepping to see if it already exists, we only checked the first
component. This means that something like keyserver-options could only
check if there were existing keyserver options of any sort, but not
which ones.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/pacman-key.sh.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index b05754e5..c3b02850 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -169,7 +169,7 @@ add_gpg_conf_option() { local conffile=$1; shift # looking for the option 'bare', only leading spaces or # chars allowed, # followed by at least one space and any other text or the end of line. - if ! grep -q "^[[:space:]#]*$1\([[:space:]].*\)*$" "$conffile" &>/dev/null; then + if ! grep -q "^[[:space:]#]*$*\([[:space:]].*\)*$" "$conffile" &>/dev/null; then printf '%s\n' "$*" >> "$conffile" fi } |