From 8a9cf32e8e55307ae4df3fb1ad17280c7ab0c28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 26 Aug 2021 15:39:08 +0200 Subject: {build,pkgtool}.sh: log environment variables at "notice" level. subr.rtl/rtl_log.subr:${RTL_LOG_MSG_{NOTICE,VERBOSE}_COLOUR}: swap. --- build.sh | 4 ++-- pkgtool.sh | 4 ++-- subr.rtl/rtl_log.subr | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index c68f7a12..404cc1d0 100755 --- a/build.sh +++ b/build.sh @@ -79,7 +79,7 @@ buildp_dispatch_pkg_state() { rtl_log_msg info_end "[%3d%%/%3d%%] [%03d/%03d] Finished \`%s' build." "${7}" "${6}" "${4}" "${5}" "${_pkg_name}"; ;; start_pkg_child) if [ "${PKG_NO_LOG_VARS:-0}" -eq 0 ]; then - rtl_log_env_vars "build" $(rtl_get_vars_fast "^PKG_"); + rtl_log_env_vars "notice" "build" $(rtl_get_vars_fast "^PKG_"); fi; if rtl_lmatch "${ARG_VERBOSE_LEVELS}" "xtrace" ","; then set -o xtrace; @@ -130,7 +130,7 @@ build() { else trap "buildp_ast exit" EXIT; trap "buildp_ast abort" HUP INT TERM USR1 USR2; buildp_time_init; rtl_log_msg info "Build started by %s@%s at %s." "${BUILD_USER}" "${BUILD_HNAME}" "${BUILD_DATE_START}"; - rtl_log_env_vars "build (global)" ${DEFAULT_LOG_ENV_VARS}; + rtl_log_env_vars "notice" "build (global)" ${DEFAULT_LOG_ENV_VARS}; ex_pkg_dispatch "${DEFAULT_BUILD_STEPS}" "${DEFAULT_BUILD_VARS}" \ buildp_dispatch "${BUILD_GROUPS}" "${BUILD_GROUPS_INHIBIT_DEPS}" \ "${ARG_PARALLEL}" "${BUILD_WORKDIR}/build.fifo" "${ARG_RESTART}" \ diff --git a/pkgtool.sh b/pkgtool.sh index 33bebd11..debc873c 100755 --- a/pkgtool.sh +++ b/pkgtool.sh @@ -15,7 +15,7 @@ pkgtoolp_info() { "${_group_name}" 1 "${_pkg_name}" "" "${BUILD_WORKDIR}"; then _rc=1; _status="Error: failed to set package environment for \`${_pkg_name}'."; else _pkg_version="$(rtl_get_var_unsafe -u "PKG_"${_pkg_name}"_VERSION")"; - rtl_log_env_vars "package" $(rtl_get_vars_fast "^PKG_${_pkg_name_uc}"); + rtl_log_env_vars "notice" "package" $(rtl_get_vars_fast "^PKG_${_pkg_name_uc}"); rtl_log_msg info "Build group: %s" "${_group_name}"; if [ -z "${PKG_DEPENDS:-}" ]; then rtl_log_msg info "Package \`%s' has no dependencies." "${_pkg_name}"; @@ -186,7 +186,7 @@ pkgtoolp_shell() { local _pkg_name="${1}" _rc=0; _status=""; if ! ex_pkg_load_dump "${_pkg_name}" "${BUILD_WORKDIR}"; then _rc=1; _status="${_status}"; - else rtl_log_env_vars "package" $(rtl_get_vars_fast "^PKG_"); + else rtl_log_env_vars "notice" "package" $(rtl_get_vars_fast "^PKG_"); rtl_log_msg info "Launching shell \`%s' within package environment and \`%s'." "${SHELL}" "${PKG_BUILD_DIR}"; rtl_log_msg info "Run \$R to rebuild \`%s'." "${_pkg_name}"; rtl_log_msg info "Run \$RS to restart the specified build step of \`%s'" "${_pkg_name}"; diff --git a/subr.rtl/rtl_log.subr b/subr.rtl/rtl_log.subr index cc692795..3e55ab85 100644 --- a/subr.rtl/rtl_log.subr +++ b/subr.rtl/rtl_log.subr @@ -33,17 +33,17 @@ RTL_LOG_MSG_SUCCESS_COLOUR=33; # Dark yellow RTL_LOG_MSG_SUCCESS_END_COLOUR=32; # Dark green RTL_LOG_MSG_INFO_COLOUR=93; # Bright yellow RTL_LOG_MSG_INFO_END_COLOUR=92; # Bright green -RTL_LOG_MSG_NOTICE_COLOUR=96; # Bright cyan -RTL_LOG_MSG_VERBOSE_COLOUR=90; # Dark grey +RTL_LOG_MSG_NOTICE_COLOUR=90; # Dark grey +RTL_LOG_MSG_VERBOSE_COLOUR=96; # Bright cyan RTL_LOG_MSG_DEBUG_COLOUR=36; # Dark cyan rtl_log_env_vars() { - local _arg_len_max=0; - rtl_log_msg info "Variables for this ${1:-build}:"; shift; + local _level="${1}" _type="${2}" _arg_len_max=0; shift 2; + rtl_log_msg "${_level}" "Variables for this ${_type}:"; _arg_len_max="$(rtl_lmax "${@}")"; while [ "${#}" -gt 0 ]; do - rtl_log_msg info \ + rtl_log_msg "${_level}" \ "%${_arg_len_max}.${_arg_len_max}s=%s" \ "${1%%=*}" "$(rtl_get_var_unsafe "${1#*=}")"; shift; -- cgit v1.2.3