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"
if [[ -n "${_GENERATE_IMAGE}" ]]; then
_create_cpio "${_GENERATE_IMAGE}" "${_COMP}" || exit 1
_cleanup
echo "Build complete."
elif [[ -n "${_TARGET_DIR}" ]]; then
_cleanup
echo "Build directory complete."
else
_cleanup
echo "Dry run complete."
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

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