diff options
| author | Julian Andres Klode <jak@debian.org> | 2021-11-04 03:49:04 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2021-11-04 03:49:04 +0000 |
| commit | fd8affa0b98761b2140f2ec8d012b5176c615550 (patch) | |
| tree | 63dcd9a5cc32141d00ca4ca5325622a3c6bb1ee5 /cmdline | |
| parent | f4c4f057665adf5d26b6d83be30362fcd837db22 (diff) | |
| parent | 48d4b06013ae3d80b95cf72efaf9a5e7468de965 (diff) | |
Merge branch 'command-v' into 'main'
Use `command -v` instead of `which`
See merge request apt-team/apt!193
Diffstat (limited to 'cmdline')
| -rw-r--r-- | cmdline/apt-key.in | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index baf3df5c3..137546de3 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -92,18 +92,7 @@ requires_root() { command_available() { if [ -x "$1" ]; then return 0; fi - # command -v "$1" >/dev/null 2>&1 # not required by policy, see #747320 - # which "$1" >/dev/null 2>&1 # is in debianutils (essential) but not on non-debian systems - local OLDIFS="$IFS" - IFS=: - for p in $PATH; do - if [ -x "${p}/${1}" ]; then - IFS="$OLDIFS" - return 0 - fi - done - IFS="$OLDIFS" - return 1 + command -v "$1" >/dev/null # required by policy, see #747320 } escape_shell() { |
