diff --git a/xbps-src/libexec/xbps-src-chroot-helper.sh.in b/xbps-src/libexec/xbps-src-chroot-helper.sh.in index 98070b23e39..440b4e74a97 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