Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2020-06-05 01:23:23 +0300
committerBryan Drewery <bryan@shatow.net>2021-09-03 01:42:09 +0300
commite5ec11d256b09dcbf78cc36183615dfc39134468 (patch)
tree5b188577263311a4ac3c31905406fe2bb7111a9a /src
parent6908b9791f182128d63c499a36682c0d506e14cc (diff)
bulk cleanup: Simplify exit needs to not care about having jlock
Also handle some things before nuking jails otherwise other bulks could race with the cleanup being done.
Diffstat (limited to 'src')
-rw-r--r--src/share/poudriere/common.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index a391b2d4..6f553fcc 100644
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -1295,19 +1295,20 @@ exit_handler() {
# build_queue socket
exec 6>&- || :
coprocess_stop pkg_cacher
+ coprocess_stop html_json
fi
- [ ${STATUS} -eq 1 ] && jail_cleanup
-
- if was_a_bulk_run; then
- coprocess_stop html_json
- if [ ${CREATED_JLOCK:-0} -eq 1 ]; then
+ if [ "${STATUS}" -eq 1 ]; then
+ if was_a_bulk_run; then
update_stats >/dev/null 2>&1 || :
- if [ ${DRY_RUN} -eq 1 ] && [ -n "${PACKAGES_ROOT}" ] &&
+ if [ "${DRY_RUN:-0}" -eq 1 ] &&
+ [ -n "${PACKAGES_ROOT-}" ] &&
[ ${PACKAGES_MADE_BUILDING:-0} -eq 1 ] ; then
rm -rf "${PACKAGES_ROOT}/.building" || :
fi
fi
+
+ jail_cleanup
fi
[ -n "${CLEANUP_HOOK-}" ] && ${CLEANUP_HOOK}