Revert "grml-live: clean up MIRROR_DIRECTORY if provided."
authorMichael Prokop <mika@grml.org>
Sat, 24 Apr 2021 21:34:41 +0000 (23:34 +0200)
committerMichael Prokop <mika@grml.org>
Sat, 24 Apr 2021 21:34:41 +0000 (23:34 +0200)
This reverts commit c78f58bfee79af61276e3e91457a1b0faa55bbf5.

While deleting the bind-mount destination of mirror directories is fine
in theory, we end up deleting empty base directories as well, which
is unexpected and unwanted behavior.

See https://github.com/grml/grml-live/pull/104 for the related
discussion, this issue needs further attention yet before we can
include this in a new release of grml-live.

grml-live

index 6107e28..8b0adfe 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -180,10 +180,7 @@ umount_all() {
    fi
 
    umount "${CHROOT_OUTPUT}/grml-live/sources/" 2>/dev/null || /bin/true
-   if [ -n "${MIRROR_DIRECTORY}" ]; then
-     umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
-     rmdir -p "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
-   fi
+   [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
 }
 # }}}