diff options
Diffstat (limited to 'abuild.in')
-rwxr-xr-x | abuild.in | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -105,19 +105,29 @@ set_xterm_title() { } cleanup() { + local i= set_xterm_title "" - if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then - msg "Uninstalling dependencies..." - $SUDO_APK del --quiet $apk_opt_wait $uninstall_after - fi if [ -n "$CLEANUP_FILES" ]; then rm -f $CLEANUP_FILES fi + for i; do + case $i in + pkgdir) msg "Cleaning up pkgdir"; rm -rf "$pkgbasedir";; + srcdir) msg "Cleaning up srcdir"; rm -rf "$srcdir";; + deps) + if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then + msg "Uninstalling dependencies..." + $SUDO_APK del --quiet $apk_opt_wait \ + $uninstall_after + fi + ;; + esac + done } die() { error "$@" - cleanup + cleanup $ERROR_CLEANUP exit 1 } @@ -1210,6 +1220,7 @@ build_abuildrepo() { logcmd "building $pkgname" sanitycheck && builddeps && clean && fetch && unpack \ && prepare && mkusers && $_build && rootpkg \ + && cleanup $CLEANUP \ || return 1 fi update_abuildrepo_index |