summaryrefslogtreecommitdiff
path: root/etc/completion
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-02-07 15:01:36 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-02-28 13:36:44 +0900
commit79a46d65370418dde29b303bebcb487355564f98 (patch)
tree004dabae9f7f3e2dd3cce9782142624d5d2d46cc /etc/completion
parent99bf56fd509eccc8281667be38494db2fc01ffd2 (diff)
gnupg: Automatically fallback to 'always policy when non-interactive.
Previously to this change, the 'guix refresh' download policy (--key-download)would default to 'interactive', which would throw a backtrace when guix was invoked with its stdin not connected to a peusdo terminal (tty). This change makes the new default value 'auto' use interactive only in an interactive environment, with 'always' used as fallback. * doc/guix.texi (Invoking guix refresh): Adjust doc. * etc/completion/fish/guix.fish: Adjust accordingly. * etc/completion/zsh/_guix (_guix_list_installed_packages): Likewise. * guix/gnupg.scm (gnupg-verify*): Change default #:key-download argument value to 'auto. Update doc. Validate argument. Raise an error in case read-line returns #<eof>. * guix/import/gnu.scm (gnu-package->sexp): <#:key-download>: Change default value to 'auto. * guix/import/gnu.scm (gnu->guix-package): <#:key-download>: Likewise. * guix/scripts/import/gnu.scm (%options): Add "auto" to accepted --key-download values. (%default-options): Set default key-download option to the 'auto value. (show-help): Update doc. * guix/scripts/refresh.scm (show-help): Update doc. (update-package) <#:key-download>: Change default value to 'auto. Update doc. * guix/upstream.scm (download-tarball): <#:key-download>: Likewise. (package-update): Likewise. Change-Id: Id1ca8fd6d453ca4bc5b372534445e3beab9133a8 Fixes: https://issues.guix.gnu.org/76112 Reviewed-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'etc/completion')
-rw-r--r--etc/completion/fish/guix.fish4
-rw-r--r--etc/completion/zsh/_guix2
2 files changed, 3 insertions, 3 deletions
diff --git a/etc/completion/fish/guix.fish b/etc/completion/fish/guix.fish
index e6c290256f2..9e3b3211ea1 100644
--- a/etc/completion/fish/guix.fish
+++ b/etc/completion/fish/guix.fish
@@ -284,7 +284,7 @@ complete -f -c guix -n '__fish_guix_using_command refresh' -l list-updaters -d '
complete -f -c guix -n '__fish_guix_using_command refresh' -l list-dependent -d 'list top-level dependent packages that would need to be rebuilt as a result of upgrading PACKAGE'
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--key-server=" -d 'use HOST as the OpenPGP key server'
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--gpg=" -d 'use COMMAND as the GnuPG 2.x command'
-complete -f -c guix -n '__fish_guix_using_command refresh' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY.' --exclusive --arguments "always never interactive"
+complete -f -c guix -n '__fish_guix_using_command refresh' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY.' --exclusive --arguments "always auto never interactive"
#### publish
set -l remotecommands port= listen= user= compression ttl= repl
@@ -321,7 +321,7 @@ set -l remotecommands import gnu nix pypi cpan hackage elpa gem cran crate texli
complete -f -c guix -n '__fish_guix_needs_command' -a import -d 'Run IMPORTER with ARGS'
##### import gnu
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a gnu -d 'Return a package declaration template for PACKAGE, a GNU package.'
-complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from gnu' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY: "always", "never", and "interactive", which is also used when "key-download" is not specified.'
+complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from gnu' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY: "always", "auto", "never", and "interactive", which is also used when "key-download" is not specified.'
##### import pypi
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a pypi -d 'Import and convert the PyPI package for PACKAGE-NAME.'
##### import cpan
diff --git a/etc/completion/zsh/_guix b/etc/completion/zsh/_guix
index 9b1f16c664e..42b92475a94 100644
--- a/etc/completion/zsh/_guix
+++ b/etc/completion/zsh/_guix
@@ -507,7 +507,7 @@ _guix_list_installed_packages()
'--keyring=[use FILE as the keyring of upstream OpenPGP keys]:FILE:_files' \
'--key-server=[use HOST as the OpenPGP key server]:HOST_hosts' \
'--gpg=[use COMMAND as the GnuPG 2.x command]:COMMAND' \
- '--key-download=[handle missing OpenPGP keys according to POLICY:]:POLICY:(always interactive never)' \
+ '--key-download=[handle missing OpenPGP keys according to POLICY:]:POLICY:(always auto interactive never)' \
'--load-path=[prepend DIR to the package module search path]:DIR:_files -/' \
{-V,--version}'[display version information and exit]' \
'*:package:->packages'