From 6d5124d02e3912ac0ca53c0f0af92ef9ebceae23 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 10 Jul 2011 15:53:18 +0200 Subject: [PATCH] 98-clean-chroot: check existence of aptitude binary via $ROOTCMD. /usr/bin/aptitude might point to /etc/alternatives/aptitude which points to e.g. /usr/bin/aptitude-curses. When testing for precense of /usr/bin/aptitude the test might fail because test(1) dereferences symbolic links. So make sure to check existence of aptitude binary inside $target using $ROOTCMD. --- etc/grml/fai/config/hooks/instsoft.GRMLBASE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/grml/fai/config/hooks/instsoft.GRMLBASE b/etc/grml/fai/config/hooks/instsoft.GRMLBASE index fcc2bdb..e5e6800 100755 --- a/etc/grml/fai/config/hooks/instsoft.GRMLBASE +++ b/etc/grml/fai/config/hooks/instsoft.GRMLBASE @@ -81,11 +81,11 @@ EOF # 'aptitude -f -y install file-rc' anymore, therefore force it: $ROOTCMD aptitude -o Aptitude::ProblemResolver::Keep-All-Tier=60000 -f -y install file-rc - if ! [ -x $target/usr/bin/aptitude ] ; then + if ! $ROOTCMD test -x /usr/bin/aptitude ; then $ROOTCMD apt-get -y install aptitude fi - if [ -x $target/usr/bin/aptitude ] ; then + if $ROOTCMD test -x /usr/bin/aptitude ; then if $ROOTCMD aptitude --help | grep -q safe-upgrade ; then APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none $ROOTCMD aptitude -y safe-upgrade else -- 2.1.4