diff options
| author | Julian Andres Klode <jak@debian.org> | 2024-06-13 12:31:33 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2024-06-13 12:31:33 +0000 |
| commit | e3ae8e27027dea024ecd2f167e7a3663fdc35174 (patch) | |
| tree | 055acbe9bb19c3b2a21392b65e6018d7a477639c | |
| parent | d7ace9e28be6c65cd0e0b9b01b892ca0493db48d (diff) | |
| parent | 53597500089549f412eeef11e0e262a4810deda4 (diff) | |
Merge branch 'gpgv-options' into 'main'
Check gpgv --dump-options for --assert-pubkey-algo support
See merge request apt-team/apt!355
| -rw-r--r-- | cmdline/apt-key.in | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 07522723b..8738094b5 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -811,18 +811,8 @@ case "$command" in exit 29 fi GPGV_ARGS="" - if [ "$ASSERT_PUBKEY_ALGO" ]; then - test="$(LC_ALL=C.UTF-8 "$GPGV" --assert-pubkey-algo 2>&1 || :)" - case "$test" in - *"missing argument"*) - GPGV_ARGS="--assert-pubkey-algo=$ASSERT_PUBKEY_ALGO" - ;; - *[Ii]"nvalid option"*"assert-pubkey-algo"*) - ;; - *) - apt_warn "Unknown response from gpgv to --assert-pubkey-algo check: $test" - ;; - esac + if [ "$ASSERT_PUBKEY_ALGO" ] && $GPGV --dump-options | grep -q -- --assert-pubkey-algo; then + GPGV_ARGS="--assert-pubkey-algo=$ASSERT_PUBKEY_ALGO" fi # for a forced keyid we need gpg --export, so full wrapping required if [ -n "$FORCED_KEYID" ]; then |
