From 1793b7961a7e20a770d0212fb99e837d0ddb8477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 24 Aug 2021 13:07:43 +0200 Subject: Split ./build.sh -x from ./build.sh -vvvv. --- build.sh | 2 +- etc/README.md | 16 +++++++++------- etc/build.usage | 16 +++++++++------- etc/build.usage.short | 13 +++++++------ subr/build_init.subr | 10 +++++----- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index a9db0909..4bb26e43 100755 --- a/build.sh +++ b/build.sh @@ -81,7 +81,7 @@ buildp_dispatch_pkg_state() { if [ "${PKG_NO_LOG_VARS:-0}" -eq 0 ]; then rtl_log_env_vars "build" $(rtl_get_vars_fast "^PKG_"); fi; - if [ "${ARG_VERBOSE:-0}" -ge 3 ]; then + if [ "${ARG_XTRACE:-0}" -ge 1 ]; then set -o xtrace; fi; ;; esac; diff --git a/etc/README.md b/etc/README.md index b1ae6a21..058e1afa 100644 --- a/etc/README.md +++ b/etc/README.md @@ -246,11 +246,11 @@ Forcibly (re)download all archive files and/or Git repositories associated with ## 3.1. Fault-tolerant & highly optimised 3D laser show-equipped usage screen ``` -usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] - [-F ipv4|ipv6|offline] [-h|--help| [-p jobs] [-P] [-r ALL|LAST] - [-r [*[*[*]]]name[,..][:[^|<|<=|>|>=]step,..]] [-R] [-v[v[v[v]]]] - [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] - [--roar] [[=]|=[ ..]] +usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] + [-F ipv4|ipv6|offline] [-h|--help] [-p jobs] [-P] [-r ALL|LAST] + [-r [*[*[*]]]name[,..][:[^|<|<=|>|>=]step,..]] [-R] [-v[v[v]]] [-x] + [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] + [--roar] [[=]|=[ ..]] -a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64. -b debug|release Selects debug or release build kind; defaults to debug. @@ -302,14 +302,16 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[, -R Ignore build failures, skip printing package logs, and continue building (relaxed mode.) - -v[v[v[v]]] Be verbose; -vv: always print package logs; -vvv: set xtrace - during package builds; -vvvv: logs fileops. + -v[v[v]] Be verbose; -vv: always print package logs; -vvv: logs fileops. + -x Set xtrace during package builds. + --as-needed Don't build unless the midipix_build repository has received new commits. --debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix. --dump-on-abort Produce package environment dump files on build failure to be used in conjuction with pkg_shell.sh script (excludes -R.) --reset-state Reset package build step state on exit. + [ ..] One of: dev_packages, dist, host_deps, host_deps_rpm, host_toolchain, host_tools, minipix, native_packages, native_runtime, native_toolchain, native_tools. diff --git a/etc/build.usage b/etc/build.usage index 8ba2445c..9d0ccbf5 100644 --- a/etc/build.usage +++ b/etc/build.usage @@ -1,8 +1,8 @@ -usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] - [-F ipv4|ipv6|offline] [-h|--help| [-p jobs] [-P] [-r ALL|LAST] - [-r [*[*[*]]]name[,..][:[^|<|<=|>|>=]step,..]] [-R] [-v[v[v[v]]]] - [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] - [--roar] [[=]|=[ ..]] +usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] + [-F ipv4|ipv6|offline] [-h|--help] [-p jobs] [-P] [-r ALL|LAST] + [-r [*[*[*]]]name[,..][:[^|<|<=|>|>=]step,..]] [-R] [-v[v[v]]] [-x] + [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] + [--roar] [[=]|=[ ..]] -a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64. -b debug|release Selects debug or release build kind; defaults to debug. @@ -54,14 +54,16 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[, -R Ignore build failures, skip printing package logs, and continue building (relaxed mode.) - -v[v[v[v]]] Be verbose; -vv: always print package logs; -vvv: set xtrace - during package builds; -vvvv: logs fileops. + -v[v[v]] Be verbose; -vv: always print package logs; -vvv: logs fileops. + -x Set xtrace during package builds. + --as-needed Don't build unless the midipix_build repository has received new commits. --debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix. --dump-on-abort Produce package environment dump files on build failure to be used in conjuction with pkg_shell.sh script (excludes -R.) --reset-state Reset package build step state on exit. + [ ..] One of: dev_packages, dist, host_deps, host_deps_rpm, host_toolchain, host_tools, minipix, native_packages, native_runtime, native_toolchain, native_tools. diff --git a/etc/build.usage.short b/etc/build.usage.short index f89b75ff..24778221 100644 --- a/etc/build.usage.short +++ b/etc/build.usage.short @@ -1,11 +1,12 @@ -usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] - [-F ipv4|ipv6|offline] [-h|--help| [-p jobs] [-P] [-r ALL|LAST] - [-r [*[*[*]]]name[,..][:[^|<|<=|>|>=]step,..]] [-R] [-v[v[v[v]]]] - [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] - [--roar] [[=]|=[ ..]] +usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]] + [-F ipv4|ipv6|offline] [-h|--help] [-p jobs] [-P] [-r ALL|LAST] + [-r [*[*[*]]]name[,..][:[^|<|<=|>|>=]step,..]] [-R] [-v[v[v]]] [-x] + [--as-needed] [--debug-minipix] [--dump-on-abort] [--reset-state] + [--roar] [[=]|=[ ..]] -h|--help Show short/full help screen, respectively. - -v[v[v[v]]] Be verbose; -vv: always print package logs; -vvv: set xtrace + -v[v[v]] Be verbose; -vv: always print package logs; -vvv: logs fileops. + -x Set xtrace during package builds. [ ..] One of: dev_packages, dist, host_deps, host_deps_rpm, host_toolchain, host_tools, minipix, native_packages, diff --git a/subr/build_init.subr b/subr/build_init.subr index 1e0c7d18..205afc0d 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -128,7 +128,7 @@ buildp_init_getopts() { : ${ARCH:="nt64"}; : ${BUILD_KIND:="debug"}; ARG_AS_NEEDED=0; ARG_CLEAN_BUILDS=""; ARG_DEBUG_MINIPIX=0; ARG_DIST=""; ARG_DUMP_IN=""; ARG_DUMP_ON_ABORT=0; ARG_FETCH_FORCE=""; ARG_PARALLEL=1; ARG_RELAXED=0; ARG_RESET_PKG=0; - ARG_RESTART=""; ARG_RESTART_AT=""; ARG_RESTART_RECURSIVE=""; ARG_VERBOSE=0; + ARG_RESTART=""; ARG_RESTART_AT=""; ARG_RESTART_RECURSIVE=""; ARG_VERBOSE=0; ARG_XTRACE=0; while [ "${#}" -gt 0 ]; do case "${1}" in --as-needed) ARG_AS_NEEDED=1; _shiftfl=1; ;; @@ -166,7 +166,7 @@ buildp_init_getopts() { break; elif [ "${_shiftfl}" -gt 0 ]; then shift "${_shiftfl}"; continue; - elif getopts a:b:C:D:F:hp:Pr:R _opt; then + elif getopts a:b:C:D:F:hp:Pr:Rx _opt; then case "${_opt}" in a) ARCH="${OPTARG}"; ;; b) BUILD_KIND="${OPTARG}"; ;; @@ -182,6 +182,7 @@ buildp_init_getopts() { fi; ;; r) ARG_RESTART="${OPTARG}"; ;; R) ARG_RELAXED=1; ;; + x) ARG_XTRACE=1; ;; *) cat etc/build.usage.short; exit 1; ;; esac; shift $((${OPTIND}-1)); OPTIND=1; else if rtl_match "${1}" "=*"; then @@ -215,9 +216,8 @@ buildp_init_getopts() { 0) rtl_fileop_set_log 0; rtl_log_set_lvl 0; ;; 1) rtl_fileop_set_log 0; rtl_log_set_lvl 2; ;; 2) rtl_fileop_set_log 0; rtl_log_set_lvl 2; ;; - 3) rtl_fileop_set_log 0; rtl_log_set_lvl 2; ;; - 4) rtl_fileop_set_log 1; rtl_log_set_lvl 3; ;; - *) _rc=1; _status="Error: invalid verbosity level (max. -vvvv)"; ;; + 3) rtl_fileop_set_log 1; rtl_log_set_lvl 3; ;; + *) _rc=1; _status="Error: invalid verbosity level (max. -vvv)"; ;; esac; fi; fi; -- cgit v1.2.3