From 45012e2d47fda2981237e3c1edae52ca28a2213e Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Fri, 3 Mar 2023 10:06:43 +0700 Subject: [PATCH] Replace 'which' with 'command -v' Cf. https://lwn.net/Articles/874049/ --- debian/kali-desktop-base.postinst | 4 ++-- debian/kali-themes.postinst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/kali-desktop-base.postinst b/debian/kali-desktop-base.postinst index e3ed13e8..a1418973 100644 --- a/debian/kali-desktop-base.postinst +++ b/debian/kali-desktop-base.postinst @@ -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 diff --git a/debian/kali-themes.postinst b/debian/kali-themes.postinst index b0cdcc68..43122014 100644 --- a/debian/kali-themes.postinst +++ b/debian/kali-themes.postinst @@ -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