diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/poudriere.8 | 12 | ||||
-rwxr-xr-x | src/share/poudriere/status.sh | 91 |
2 files changed, 52 insertions, 51 deletions
diff --git a/src/bin/poudriere.8 b/src/bin/poudriere.8 index 5adb0e24..d0b46ea7 100644 --- a/src/bin/poudriere.8 +++ b/src/bin/poudriere.8 @@ -27,7 +27,7 @@ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd April 22, 2014 +.Dd April 23, 2014 .Dt POUDRIERE 8 .Os .Sh NAME @@ -595,6 +595,8 @@ Show all builds, not just currently running. This is implied by the .Fl B flag. +.It Fl b +Show details about what each builder for the matched build are doing. .It Fl B Ar name Specifies which buildname to match on. Defaults to "latest". @@ -604,20 +606,18 @@ flag. .It Fl j Ar name Specifies the .Ar name -of the jail to view the status of. +of the jail to filter by. .It Fl l Show logs instead of URL. .It Fl p Ar tree This flag specifies which ports .Ar tree -the build is running on when using -.Fl j +to filter builds by. .It Fl H Do not print headers and separate fields by a single tab instead of arbitrary white space. .It Fl z Ar set -This specifies which SET the build is running on when using -.Fl j +This specifies which SET to filter builds by. .El .Pp .Sh ENVIRONMENT diff --git a/src/share/poudriere/status.sh b/src/share/poudriere/status.sh index 07bab057..766c8fdc 100755 --- a/src/share/poudriere/status.sh +++ b/src/share/poudriere/status.sh @@ -31,6 +31,7 @@ poudriere status [options] Options: -a -- Show all builds, not just running. This is default if -B is specified. + -b -- Display status of each builder for the matched build. -B name -- What buildname to use (must be unique, defaults to "latest") -j name -- Run on the given jail @@ -52,14 +53,18 @@ BUILDNAME=latest SCRIPT_MODE=0 ALL=0 URL=1 +BUILDER_INFO=0 . ${SCRIPTPREFIX}/common.sh -while getopts "aB:j:lp:Hz:" FLAG; do +while getopts "abB:j:lp:Hz:" FLAG; do case "${FLAG}" in a) ALL=1 ;; + b) + BUILDER_INFO=1 + ;; B) BUILDNAME="${OPTARG}" ALL=1 @@ -101,55 +106,46 @@ fi POUDRIERE_BUILD_TYPE=bulk now="$(date +%s)" -if [ -n "${JAILNAME}" ]; then - MASTERNAME=${JAILNAME}-${PTNAME:-default}${SETNAME:+-${SETNAME}} - MASTERMNT=${POUDRIERE_DATA}/build/${MASTERNAME}/ref - if [ ${ALL} -eq 0 ]; then - jail_runs ${MASTERNAME} || \ - err 1 "Jail ${MASTERNAME} is not running" +if [ ${SCRIPT_MODE} -eq 0 -a ${BUILDER_INFO} -eq 0 ]; then + format="%-40s %-25s %6s %5s %6s %7s %7s %7s %9s %s" + printf "${format}" "JAIL" "STATUS" "QUEUED" \ + "BUILT" "FAILED" "SKIPPED" "IGNORED" "TOBUILD" \ + "TIME" + if [ -n "${URL_BASE}" ] && [ ${URL} -eq 1 ]; then + echo -n "URL" + else + echo -n "LOGS" fi + echo +else + format="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" +fi +for mastermnt in ${POUDRIERE_DATA}/logs/bulk/*; do + # Check empty dir + case "${mastermnt}" in + "${POUDRIERE_DATA}/logs/bulk/*") break ;; + esac + MASTERNAME=${mastermnt#${POUDRIERE_DATA}/logs/bulk/} + # Skip non-running on ALL=0 + [ ${ALL} -eq 0 ] && ! jail_runs ${MASTERNAME} && continue # Dereference latest into actual buildname BUILDNAME="$(BUILDNAME="${ORIG_BUILDNAME}" bget buildname 2>/dev/null || :)" - [ -z "${BUILDNAME}" ] && err 1 "No such build ${ORIG_BUILDNAME}" - builders="$(bget builders 2>/dev/null || :)" - - JOBS="${builders}" siginfo_handler -else - if [ ${SCRIPT_MODE} -eq 0 ]; then - format="%-40s %-25s %6s %5s %6s %7s %7s %7s %9s %s" - printf "${format}" "JAIL" "STATUS" "QUEUED" \ - "BUILT" "FAILED" "SKIPPED" "IGNORED" "TOBUILD" \ - "TIME" - if [ -n "${URL_BASE}" ] && [ ${URL} -eq 1 ]; then - echo -n "URL" - else - echo -n "LOGS" - fi - echo - else - format="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" + # No matching build, skip. + [ -z "${BUILDNAME}" ] && continue + if [ -n "${JAILNAME}" ]; then + jailname=$(bget jailname) + [ "${jailname}" = "${JAILNAME}" ] || continue fi - for mastermnt in ${POUDRIERE_DATA}/logs/bulk/*; do - # Check empty dir - case "${mastermnt}" in - "${POUDRIERE_DATA}/logs/bulk/*") break ;; - esac - MASTERNAME=${mastermnt#${POUDRIERE_DATA}/logs/bulk/} - # Skip non-running on ALL=0 - [ ${ALL} -eq 0 ] && ! jail_runs ${MASTERNAME} && continue - # Dereference latest into actual buildname - BUILDNAME="$(BUILDNAME="${ORIG_BUILDNAME}" bget buildname 2>/dev/null || :)" - # No matching build, skip. - [ -z "${BUILDNAME}" ] && continue + if [ -n "${PTNAME}" ]; then ptname=$(bget ptname) + [ "${ptname}" = "${PTNAME}" ] || continue + fi + if [ -n "${SETNAME}" ]; then setname=$(bget setname) - if [ -n "${PTNAME}" ]; then - [ "${ptname}" = "${PTNAME}" ] || continue - fi - if [ -n "${SETNAME}" ]; then - [ "${setname}" = "${SETNAME}" ] || continue - fi + [ "${setname}" = "${SETNAME}" ] || continue + fi + if [ ${BUILDER_INFO} -eq 0 ]; then status=$(bget status 2>/dev/null || :) nbqueued=$(bget stats_queued 2>/dev/null || :) nbfailed=$(bget stats_failed 2>/dev/null || :) @@ -171,5 +167,10 @@ else printf "${format}\n" "${MASTERNAME}" "${status}" "${nbqueued}" \ "${nbbuilt}" "${nbfailed}" "${nbskipped}" "${nbignored}" \ "${nbtobuild}" "${time}" "${url}" - done -fi + else + + builders="$(bget builders 2>/dev/null || :)" + + JOBS="${builders}" siginfo_handler + fi +done |