From 649b40f7780079f8af4fcd7b12284a7d1d8cccfc Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 28 Jun 2011 11:49:36 +0200 Subject: [PATCH 1/1] DEBORPHAN/98-clean-chroot: Make sure deborphan exists in chroot. --- etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot b/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot index a5515f0..f5c1a94 100755 --- a/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot +++ b/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot @@ -9,12 +9,17 @@ set -u set -e +if ! [ -x $target/usr/bin/deborphan ] ; then + echo "Warning: deborphan not installed" + exit 0 +fi + # remove all packages not necessary anymore: $ROOTCMD apt-get -y --purge autoremove # remove packages until deborphan does not find anymore: while [ "$($ROOTCMD deborphan)" != "" ] ; do - $ROOTCMD apt-get -y --purge remove $(deborphan) + $ROOTCMD apt-get -y --purge remove $($ROOTCMD deborphan) done ## END OF FILE ################################################################# -- 2.1.4