Replace 'which' with 'command -v'

Cf. https://lwn.net/Articles/874049/
This commit is contained in:
Arnaud Rebillout 2023-03-03 10:06:43 +07:00
parent 2be92c7e69
commit 45012e2d47
No known key found for this signature in database
GPG Key ID: E725E87914600216
2 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remov
# Some people use the *-bin packages without using GRUB as bootloader
# (see #851893 for more context).
if dpkg-query --list "grub-*" | grep -v "^... grub\(-common\|-emu\|[^[:space:]]*\(-bin\|-doc\)\)" | grep -q "^[ih][HUFWti] " \
&& which update-grub > /dev/null ; then
&& command -v update-grub > /dev/null ; then
# Ensure the background image file has actually been written to disc
# before updating.
sync
@ -98,7 +98,7 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remov
update-grub || echo "Updating grub failed, report success anyway!"
fi
if which update-initramfs > /dev/null; then
if command -v update-initramfs > /dev/null; then
update-initramfs -u
fi

View File

@ -160,11 +160,11 @@ if [ "$1" = "configure" ]; then
sed -i 's/grub-16x9\.png/grub-4x3.png/' /boot/grub/themes/kali/theme.txt
fi
# Rebuild the grub configuration with our config changes
if which update-grub >/dev/null; then
if command -v update-grub >/dev/null; then
update-grub || true
fi
# Rebuild the initrd for plymouth
if which update-initramfs >/dev/null; then
if command -v update-initramfs >/dev/null; then
update-initramfs -u
fi
fi