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/share
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2014-04-24 02:27:38 +0400
committerBryan Drewery <bryan@shatow.net>2014-04-24 02:27:38 +0400
commitf4a51d899df68d7c181875f273bfc19bd6369117 (patch)
treeb169b378f96e06a8bac6ad778aa9a798381d7e83 /src/share
parent5eb4a9eb221af64059ae9f86fa530c7a83b2d26f (diff)
SIGINFO: Don't show builders for stopped builds
Diffstat (limited to 'src/share')
-rwxr-xr-xsrc/share/poudriere/common.sh26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index 3edb92ff..95af76f4 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -468,8 +468,10 @@ siginfo_handler() {
printf "[${MASTERNAME}] [${status}] Queued: %-${queue_width}d Built: %-${queue_width}d Failed: %-${queue_width}d Skipped: %-${queue_width}d Ignored: %-${queue_width}d Tobuild: %-${queue_width}d Time: %s \n" \
${nbq} ${nbb} ${nbf} ${nbs} ${nbi} ${nbtobuild} "${buildtime}"
- # Skip if stopping or starting jobs
- if [ -n "${JOBS}" -a "${status#starting_jobs:}" = "${status}" -a "${status}" != "stopping_jobs:" ]; then
+ # Skip if stopping or starting jobs or stopped.
+ if [ -n "${JOBS}" -a "${status#starting_jobs:}" = "${status}" \
+ -a "${status}" != "stopping_jobs:" ] && \
+ ! status_is_stopped "${status}"; then
format_origin_phase="\t[%s]: %-32s %-15s (%s)\n"
format_phase="\t[%s]: %15s\n"
@@ -2099,6 +2101,15 @@ calculate_tobuild() {
echo ${nremaining}
}
+status_is_stopped() {
+ [ $# -eq 1 ] || eargs status_is_stopped status
+ local status="$1"
+ case "${status}" in
+ sigterm:|sigint:|crashed:|stop:|stopped:*) return 0 ;;
+ esac
+ return 1
+}
+
calculate_elapsed() {
[ $# -eq 2 ] || eargs calculate_elapsed now log
local now="$1"
@@ -2107,12 +2118,11 @@ calculate_elapsed() {
[ -f "${log}/.poudriere.status" ] || return 1
start_end_time=$(stat -f '%B %m' ${log}/.poudriere.status)
start_time=${start_end_time% *}
- case "${status}" in
- sigterm:|sigint:|crashed:|stop:|stopped:*)
- end_time=${start_end_time#* }
- ;;
- *) end_time=${now} ;;
- esac
+ if status_is_stopped "${status}"; then
+ end_time=${start_end_time#* }
+ else
+ end_time=${now}
+ fi
_start_time=${start_time}
_end_time=${end_time}
_elapsed_time=$((${end_time} - ${start_time}))