diff options
author | Bryan Drewery <bryan@shatow.net> | 2019-10-11 20:59:06 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2019-10-11 20:59:06 +0300 |
commit | 77cbefc72501df78689949c7898bf6b7a208db58 (patch) | |
tree | 00177153a4e1cdd1e25daee37f1d01ed85af795c /src | |
parent | 91892a7d8804db533c9227e5332765c3b22d6097 (diff) |
Compute queued stats after trimming ignored AND trimming queue.
This avoids showing a negative value for Tobuild. It does show
the truth that many were queued and then after trimming less are
in the queue. It might make sense to have an Unchanged column
since the ones removed from Queued won't reflect the original
value of Queued.
Fixes #727
Diffstat (limited to 'src')
-rwxr-xr-x | src/share/poudriere/common.sh | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index dca1a0f3..737f34f3 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1058,6 +1058,22 @@ update_stats() { lock_release update_stats } +update_stats_queued() { + [ $# -eq 0 ] || eargs update_stats_queued + local nbq nbi nbs + + nbq=$(pkgqueue_list | wc -l) + # Need to add in pre-build ignored/skipped + _bget nbi stats_ignored || nbi=0 + _bget nbs stats_skipped || nbs=0 + nbq=$((nbq + nbi + nbs)) + + # Add 1 for the main port to test + was_a_testport_run && \ + nbq=$((${nbq} + 1)) + bset stats_queued ${nbq##* } +} + sigpipe_handler() { EXIT_STATUS="sigpipe:" SIGNAL="SIGPIPE" @@ -7019,6 +7035,7 @@ trim_ignored() { done # Update ignored/skipped stats update_stats + update_stats_queued } trim_ignored_pkg() { @@ -7091,7 +7108,7 @@ clean_build_queue() { prepare_ports() { local pkg local log log_top - local n nbq nbi nbs resuming_build + local n resuming_build local cache_dir sflag delete_pkg_list shash_bucket _log_path log @@ -7316,6 +7333,10 @@ prepare_ports() { export LOCALBASE=${LOCALBASE:-/usr/local} clean_build_queue + if was_a_bulk_run && [ "${resuming_build}" -eq 0 ]; then + # Update again after trimming the build queue + update_stats_queued + fi # Call the deadlock code as non-fatal which will check for cycles msg "Sanity checking build queue" @@ -7324,17 +7345,6 @@ prepare_ports() { if was_a_bulk_run; then if [ "${resuming_build}" -eq 0 ]; then - nbq=$(pkgqueue_list | wc -l) - # Need to add in pre-build ignored/skipped - _bget nbi stats_ignored || nbi=0 - _bget nbs stats_skipped || nbs=0 - nbq=$((nbq + nbi + nbs)) - - # Add 1 for the main port to test - was_a_testport_run && \ - nbq=$((${nbq} + 1)) - bset stats_queued ${nbq##* } - # Generate ports.queued list after the queue was # trimmed. local _originspec _pkgname _rdep _ignore tmp |