From 6b240bbf46752bbf10e3aed025de06bc3d2284b3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 5 Jul 2011 14:23:43 +0200 Subject: [PATCH] xbps-src: remove dirs for bind mounts on chroot exit. --- xbps-src/libexec/xbps-src-chroot-helper.sh.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xbps-src/libexec/xbps-src-chroot-helper.sh.in b/xbps-src/libexec/xbps-src-chroot-helper.sh.in index 98070b23e3..440b4e74a9 100644 --- a/xbps-src/libexec/xbps-src-chroot-helper.sh.in +++ b/xbps-src/libexec/xbps-src-chroot-helper.sh.in @@ -107,11 +107,13 @@ umount_chroot_fs() done # Remove created dirs - if [ ! -f ${XBPS_MASTERDIR}/.xbps_mount_bind_done ]; then - if [ -d ${XBPS_MASTERDIR}/xbps ]; then - rmdir ${XBPS_MASTERDIR}/xbps 2>/dev/null + for fs in xbps cachedir; do + if [ ! -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done ]; then + if [ -d ${XBPS_MASTERDIR}/${fs} ]; then + rmdir ${XBPS_MASTERDIR}/${fs} 2>/dev/null + fi fi - fi + done } if [ $# -ne 1 ]; then