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
diff options
context:
space:
mode:
-rwxr-xr-xsrc/share/poudriere/common.sh42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index af13d175..8590448b 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -1010,17 +1010,17 @@ buildlog_stop() {
local originspec=$2
local build_failed="$3"
local log
- local buildtime
+ local now elapsed buildtime
_log_path log
- buildtime=$( \
- stat -f '%N %B' ${log}/logs/${pkgname}.log | awk -v now=$(clock -epoch) \
- -f ${AWKPREFIX}/siginfo_buildtime.awk |
- awk -F'!' '{print $2}' \
- )
echo "build of ${originspec} | ${pkgname} ended at $(date)"
- echo "build time: ${buildtime}"
+ if [ -n "${TIME_START_JOB:-}" ]; then
+ now=$(clock -monotonic)
+ elapsed=$((now - TIME_START_JOB))
+ calculate_duration buildtime "${elapsed}"
+ echo "build time: ${buildtime}"
+ fi
if [ ${build_failed} -gt 0 ]; then
echo "!!! build failure encountered !!!"
fi
@@ -1580,26 +1580,27 @@ siginfo_handler() {
EOF
for j in ${JOBS}; do
# Ignore error here as the zfs dataset may not be cloned yet.
- _bget status ${j} status || :
+ _bget status ${j} status || status=
# Skip builders not started yet
if [ -z "${status}" ]; then
continue
fi
+ set -f
+ IFS=:
+ set -- ${status}
+ unset IFS
+ set +f
+ phase="${1}"
+
# Hide idle workers
- case "${status}" in
- idle:|done:) continue ;;
+ case "${phase}" in
+ idle|done) continue ;;
esac
- phase="${status%%:*}"
- status="${status#*:}"
- origin="${status%%:*}"
- status="${status#*:}"
- pkgname="${status%%:*}"
- status="${status#*:}"
- started="${status%%:*}"
- status="${status#*:}"
- started_phase="${status%%:*}"
- colorize_job_id job_id_color "${j}"
+ origin="${2-}"
+ pkgname="${3-}"
+ started="${4-}"
+ started_phase="${5-}"
if [ -n "${pkgname}" ]; then
elapsed=$((now - started))
@@ -1619,6 +1620,7 @@ siginfo_handler() {
cpu=
mem=
fi
+ colorize_job_id job_id_color "${j}"
display_add \
"[" "${job_id_color}" "${j}" "]" \
"${buildtime-}" \