diff --git a/usr/bin/archboot-cpio.sh b/usr/bin/archboot-cpio.sh index a3ebe0b7e..9ddde3e5e 100755 --- a/usr/bin/archboot-cpio.sh +++ b/usr/bin/archboot-cpio.sh @@ -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: diff --git a/usr/lib/archboot/cpio/cpio.sh b/usr/lib/archboot/cpio/cpio.sh index 458720e90..7671f0f95 100644 --- a/usr/lib/archboot/cpio/cpio.sh +++ b/usr/lib/archboot/cpio/cpio.sh @@ -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() {