From 3961f3d554a2ac9f6d0477ffb0dc539e7842d676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Wed, 22 Nov 2017 20:55:13 +0000 Subject: build.sh:-R: always print/don't print std{out,err} logs for failed packages. build.sh:-vv: always print/don't print stdout logs for successfully built packages. subr/ex_rtl_fileop.subr:ex_build_fileop(): log at vvvo (-vvv.) subr/ex_rtl_log.subr, vars/env.vars: removes [vw]arn, separates info & {vnfo,vvfo,vvvo}. var/env.vars:${CLEAR_ENV_VARS_EXCEPT}: adds ARG_VERBOSE[23]. --- subr/ex_rtl_fileop.subr | 12 ++++++------ subr/ex_rtl_log.subr | 12 +++++------- subr/pkg_fetch_wget.subr | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'subr') diff --git a/subr/ex_rtl_fileop.subr b/subr/ex_rtl_fileop.subr index 3732ab5e..9cf44231 100644 --- a/subr/ex_rtl_fileop.subr +++ b/subr/ex_rtl_fileop.subr @@ -5,16 +5,16 @@ ex_build_fileop() { local _op="${1}"; shift; if [ "${_op}" = cd ]; then - ex_log_msg varn "Changing working directory to \`${1}'."; + ex_log_msg vvvo "Changing working directory to \`${1}'."; [ \( -n "${1}" \) -a \( -L "${1}" -o -e "${1}" \) ] && cd -- "${1}"; elif [ "${_op}" = cp ]; then - ex_log_msg varn "Copying \`${1}' to \`${2}' w/ -pPR."; + ex_log_msg vvvo "Copying \`${1}' to \`${2}' w/ -pPR."; [ ${#} -ge 2 ] && cp -pPR -- "${@}"; elif [ "${_op}" = ln_symbolic ]; then - ex_log_msg varn "Linking \`${1}' to \`${2}' w/ -fs"; + ex_log_msg vvvo "Linking \`${1}' to \`${2}' w/ -fs"; [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- "${1}" "${2}"; elif [ "${_op}" = mv ]; then - ex_log_msg varn "Moving \`${1}' to \`${2}' w/ -fs"; + ex_log_msg vvvo "Moving \`${1}' to \`${2}' w/ -fs"; [ \( -n "${1}" \) -a \( -n "${2}" \) ] && mv -f -- "${1}" "${2}"; elif [ "${_op}" = mkdir ]\ || [ "${_op}" = rm ]; then @@ -23,11 +23,11 @@ ex_build_fileop() { return 1; elif [ "${_op}" = mkdir ]\ && [ ! -e "${1}" ]; then - ex_log_msg varn "Making directory \`${1}'."; + ex_log_msg vvvo "Making directory \`${1}'."; mkdir -p -- "${1}"; elif [ "${_op}" = rm ]\ && [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then - ex_log_msg varn "Removing directory or file \`${1}'."; + ex_log_msg vvvo "Removing directory or file \`${1}'."; rm -rf -- "${1}"; fi; shift; done; diff --git a/subr/ex_rtl_log.subr b/subr/ex_rtl_log.subr index 31d5cead..c44085a6 100644 --- a/subr/ex_rtl_log.subr +++ b/subr/ex_rtl_log.subr @@ -26,22 +26,20 @@ ex_log_msg() { && [ ${ARG_VERBOSE:-0} -eq 0 ]; then return; elif [ "${_lvl}" = vvfo ]\ - && [ ${ARG_VERBOSE1:-0} -eq 0 ]; then + && [ ${ARG_VERBOSE2:-0} -eq 0 ]; then return; elif [ "${_lvl}" = vvvo ]\ - && [ ${ARG_VERBOSE2:-0} -eq 0 ]; then + && [ ${ARG_VERBOSE3:-0} -eq 0 ]; then return; fi; case "${_lvl}" in failexit) printf "\033[0m\033[${LOG_MSG_FAIL_COLOUR}m"; ;; fail) printf "\033[0m\033[${LOG_MSG_FAIL_COLOUR}m"; ;; info) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;; - vnfo) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;; - vvfo) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;; - vvvo) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;; + vnfo) printf "\033[0m\033[${LOG_MSG_VNFO_COLOUR}m"; ;; + vvfo) printf "\033[0m\033[${LOG_MSG_VVFO_COLOUR}m"; ;; + vvvo) printf "\033[0m\033[${LOG_MSG_VVVO_COLOUR}m"; ;; succ) printf "\033[0m\033[${LOG_MSG_SUCC_COLOUR}m"; ;; - warn) printf "\033[0m\033[${LOG_MSG_WARN_COLOUR}m"; ;; - varn) printf "\033[0m\033[${LOG_MSG_WARN_COLOUR}m"; ;; esac; if [ ${#} -gt 1 ]; then printf "==> %s %s %s\033[0m\n" "$(ex_date)" "${1}" "$*"; diff --git a/subr/pkg_fetch_wget.subr b/subr/pkg_fetch_wget.subr index 731354e8..95fdc081 100644 --- a/subr/pkg_fetch_wget.subr +++ b/subr/pkg_fetch_wget.subr @@ -22,7 +22,7 @@ pkgp_fetch_wget() { if [ "${ARG_IGNORE_SHA256SUMS:-0}" -eq 0 ]; then ex_log_msg failexit "Error: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)"; else - ex_log_msg warn "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)"; + ex_log_msg vnfo "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)"; fi; fi; fi; -- cgit v1.2.3