From: Michael Prokop Date: Tue, 15 May 2012 20:41:02 +0000 (+0200) Subject: DEBORPHAN/98-clean-chroot: purge removed packages X-Git-Tag: v0.19.2~10 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=193203a7b81d595703d7da56e072d19cb21c5510 DEBORPHAN/98-clean-chroot: purge removed packages Make sure we don't have any removed but not-yet-purged packages left, otherwise GRMLBASE/03-get-sources might try to download unavailable packages and will fail doing so. --- diff --git a/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot b/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot index f5c1a94..8c08357 100755 --- a/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot +++ b/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot @@ -22,5 +22,14 @@ while [ "$($ROOTCMD deborphan)" != "" ] ; do $ROOTCMD apt-get -y --purge remove $($ROOTCMD deborphan) done +# make sure we don't have any removed but not-yet-purged packages left, +# otherwise GRMLBASE/03-get-sources might try to download unavailable +# packages and will fail doing so +PURGE_PACKAGES=$($ROOTCMD dpkg --list | awk '/^rc/ {print $2}') + +if [ -n "$PURGE_PACKAGES" ] ; then + $ROOTCMD dpkg --purge $PURGE_PACKAGES +fi + ## END OF FILE ################################################################# # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2