add correct cleanup

This commit is contained in:
Tobias Powalowski 2023-10-15 08:52:09 +02:00
parent 02bb17c6af
commit f4e4b9f403
2 changed files with 7 additions and 1 deletions

View file

@ -88,10 +88,13 @@ ldconfig -r "${_ROOTFS}" &>"${_NO_LOG}" || exit 1
rm -f -- "${_ROOTFS}/var/cache/ldconfig/aux-cache" rm -f -- "${_ROOTFS}/var/cache/ldconfig/aux-cache"
if [[ -n "${_GENERATE_IMAGE}" ]]; then if [[ -n "${_GENERATE_IMAGE}" ]]; then
_create_cpio "${_GENERATE_IMAGE}" "${_COMP}" || exit 1 _create_cpio "${_GENERATE_IMAGE}" "${_COMP}" || exit 1
_cleanup
echo "Build complete." echo "Build complete."
elif [[ -n "${_TARGET_DIR}" ]]; then elif [[ -n "${_TARGET_DIR}" ]]; then
_cleanup
echo "Build directory complete." echo "Build directory complete."
else else
_cleanup
echo "Dry run complete." echo "Dry run complete."
fi fi
# vim: set ft=sh ts=4 sw=4 et: # vim: set ft=sh ts=4 sw=4 et:

View file

@ -31,10 +31,13 @@ EOF
_abort() { _abort() {
echo "ERROR:" "$@" echo "ERROR:" "$@"
exit 1
}
_cleanup() {
if [[ -n "${_BUILD_DIR}" ]]; then if [[ -n "${_BUILD_DIR}" ]]; then
rm -rf -- "${_BUILD_DIR}" rm -rf -- "${_BUILD_DIR}"
fi fi
exit 1
} }
_builtin_modules() { _builtin_modules() {