From 199476a3ee4fb6e6e4e71f719c9f29f5fa93cf5d Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 7 Jan 2011 11:07:52 +0100 Subject: [PATCH] post-maintainer scripts: make sure update-grub is present before executing it. Reported-by: Samat K Jain --- debian/postinst | 8 ++++++-- debian/postrm | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/postinst b/debian/postinst index 99343dc..eb3a28d 100644 --- a/debian/postinst +++ b/debian/postinst @@ -6,8 +6,12 @@ set -e case "$1" in configure) if ls /boot/grml/*iso >/dev/null 2>&1 ; then - echo "ISOs found inside /boot/grml, invoking update-grub:" - update-grub + if which update-grub >/dev/null 2>&1; then + echo "ISOs found inside /boot/grml, invoking update-grub:" + update-grub + else + echo "WARN: ISOs found inside /boot/grml but update-grub not present (huh?)" + fi else echo "No *.iso files found inside /boot/grml/. Please create /boot/grml and" echo "place Grml ISO(s) there. Finally invoke update-grub and enjoy your rescue system." diff --git a/debian/postrm b/debian/postrm index 6291c90..2154b59 100644 --- a/debian/postrm +++ b/debian/postrm @@ -5,8 +5,10 @@ set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - echo "Updating grub.cfg to make sure there are no non-existing entries being left." - update-grub + if which update-grub >/dev/null 2>&1; then + echo "Updating grub.cfg to make sure there are no non-existing entries being left." + update-grub + fi ;; *) -- 2.1.4