midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

f0dfe1 build.sh, etc/build.usage, subr/build_args.subr: replaces -x w/ -vvv.

Authored and Committed by Lucio Andrés Illanes Albornoz 6 years ago
    build.sh, etc/build.usage, subr/build_args.subr: replaces -x w/ -vvv.
    subr/ex_rtl_{fileop,log}.subr, vars/env.vars: log file operations at -vvvv.
    
        
file modified
+1 -1
build.sh CHANGED
@@ -82,7 +82,7 @@ buildp_dispatch() {
82
82
ex_rtl_log_env_vars "build" \
83
83
$(set | awk -F= '/^PKG_/{print $1}' | sort);
84
84
fi;
85
- if [ "${ARG_XTRACE:-0}" -eq 1 ]; then
85
+ if [ "${ARG_VERBOSE:-0}" -ge 3 ]; then
86
86
set -o xtrace;
87
87
fi; ;;
88
88
exec_step) ex_rtl_log_msg info "Finished build step ${4} of package \`${_pkg_name}'."; ;;
file modified
+2 -3
etc/build.usage CHANGED
@@ -1,6 +1,6 @@
1
1
usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]]
2
2
[-F ipv4|ipv6|offline] [-h] [-P [jobs]] [-r ALL|name[,..][:step,..]]
3
- [-R] [-v[v[v]]] [-x] [--as-needed] [--debug-minipix] [<target>[ ..]]
3
+ [-R] [-v[v[v[v]]]] [--as-needed] [--debug-minipix] [<target>[ ..]]
4
4
-a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64.
5
5
-b debug|release Selects debug or release build; defaults to debug.
6
6
-C dir[,..] Clean build directory (build,) ${PREFIX} before processing build
@@ -31,8 +31,7 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-C dir[,..]] [-D kind[,..]]
31
31
install_strip, install, and install_rpm.
32
32
-R Ignore build failures, skip printing package logs, and continue
33
33
building (relaxed mode.)
34
- -v[v[v]] Be verbose; -vv: always print package logs; -vvv: logs fileops.
34
+ -v[v[v[v]]] Be verbose; -vv: always print package logs; -vvv: set xtrace during package builds; -vvvv: logs fileops.
35
- -x Set xtrace during package builds; implies -vv.
36
35
--as-needed Don't build unless the midipix_build repository has received new commits.
37
36
--debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix.
38
37
<target>[ ..] One of:
file modified
+7 -10
subr/build_args.subr CHANGED
@@ -15,7 +15,7 @@ BUILD_ARGS_SPEC="
15
15
ARG_VERBOSE:selfarg:-v:
16
16
ARG_VERBOSE:selfarg:-vv:
17
17
ARG_VERBOSE:selfarg:-vvv:
18
- ARG_XTRACE:-x:
18
+ ARG_VERBOSE:selfarg:-vvvv:
19
19
BUILD:arg:-b:";
20
20
21
21
build_args() {
@@ -69,15 +69,12 @@ build_args() {
69
69
fi;
70
70
ARG_RESTART="$(echo "${ARG_RESTART}" | sed "s/,/ /g")";
71
71
fi;
72
- if [ "${ARG_XTRACE:-0}" -eq 1 ]; then
73
- ARG_VERBOSE=2;
74
- else
75
- case "${ARG_VERBOSE}" in
76
- -v) ARG_VERBOSE=1; ;;
77
- -vv) ARG_VERBOSE=2; ;;
72
+ case "${ARG_VERBOSE}" in
73
+ -v) ARG_VERBOSE=1; ;;
74
+ -vv) ARG_VERBOSE=2; ;;
75
+ -vvv) ARG_VERBOSE=3; ;;
76
+ -vvvv) ARG_VERBOSE=4; ;;
77
+ esac;
78
- -vvv) ARG_VERBOSE=3; ;;
79
- esac;
80
- fi;
81
78
while [ ${#} -gt 0 ]; do
82
79
case "${1}" in
83
80
*=*) ex_rtl_set_var_unsafe "${1%%=*}" "${1#*=}"; ;;
file modified
+10 -10
subr/ex_rtl_fileop.subr CHANGED
@@ -15,7 +15,7 @@ ex_rtl_fileop() {
15
15
cd) if [ \( -z "${1}" \) -o ! \( -L "${1}" -o -e "${1}" \) ]; then
16
16
ex_rtl_log_msg failexit "Invalid or non-existent directory \`${1}'.";
17
17
else
18
- ex_rtl_log_msg vvvo "Changing working directory to \`${1}'.";
18
+ ex_rtl_log_msg vvvv "Changing working directory to \`${1}'.";
19
19
exp_rtl_fileop_check "${PREFIX}" "${1}";
20
20
cd -- "${1}";
21
21
fi; ;;
@@ -25,7 +25,7 @@ ex_rtl_fileop() {
25
25
else
26
26
_src="${*}"; _src="${_src% *}";
27
27
_dst="${*}"; _dst="${_dst##* }";
28
- ex_rtl_log_msg vvvo "Copying \`${_src}' into \`${_dst}' w/ -pLR.";
28
+ ex_rtl_log_msg vvvv "Copying \`${_src}' into \`${_dst}' w/ -pLR.";
29
29
exp_rtl_fileop_check "${PREFIX}" "${*}";
30
30
cp -pLR -- "${@}";
31
31
fi; ;;
@@ -34,7 +34,7 @@ ex_rtl_fileop() {
34
34
else
35
35
_src="${*}"; _src="${_src% *}";
36
36
_dst="${*}"; _dst="${_dst##* }";
37
- ex_rtl_log_msg vvvo "Copying \`${_src}' into \`${_dst}' w/ -pPR.";
37
+ ex_rtl_log_msg vvvv "Copying \`${_src}' into \`${_dst}' w/ -pPR.";
38
38
exp_rtl_fileop_check "${PREFIX}" "${*}";
39
39
cp -pPR -- "${@}";
40
40
fi; ;;
@@ -46,13 +46,13 @@ ex_rtl_fileop() {
46
46
if ex_rtl_fileop test "${2}"; then
47
47
ex_rtl_fileop rm "${2}";
48
48
fi;
49
- ex_rtl_log_msg vvvo "Linking \`${1}' to \`${2}' w/ -fs";
49
+ ex_rtl_log_msg vvvv "Linking \`${1}' to \`${2}' w/ -fs";
50
50
ln -fs -- "${1}" "${2}";
51
51
fi; ;;
52
52
mv) if [ \( -z "${1}" \) -o \( -z "${2}" \) ]; then
53
53
ex_rtl_log_msg failexit "Missing parameters (in: mv ${*}.)";
54
54
else
55
- ex_rtl_log_msg vvvo "Moving \`${1}' to \`${2}' w/ -fs";
55
+ ex_rtl_log_msg vvvv "Moving \`${1}' to \`${2}' w/ -fs";
56
56
exp_rtl_fileop_check "${PREFIX}" "${1}" "${2}";
57
57
mv -f -- "${1}" "${2}";
58
58
fi; ;;
@@ -66,31 +66,31 @@ ex_rtl_fileop() {
66
66
if ex_rtl_fileop test "${1}"; then
67
67
ex_rtl_fileop rm "${1}";
68
68
fi;
69
- ex_rtl_log_msg vvvo "Making directory \`${1}'.";
69
+ ex_rtl_log_msg vvvv "Making directory \`${1}'.";
70
70
mkdir -p -- "${1}";
71
71
elif [ "${_op}" = mkfifo ]; then
72
72
exp_rtl_fileop_check "${PREFIX}" "${1}";
73
73
if ex_rtl_fileop test "${1}"; then
74
74
ex_rtl_fileop rm "${1}";
75
75
fi;
76
- ex_rtl_log_msg vvvo "Creating FIFO \`${1}'.";
76
+ ex_rtl_log_msg vvvv "Creating FIFO \`${1}'.";
77
77
exp_rtl_fileop_check "${PREFIX}" "${1}";
78
78
mkfifo -- "${1}";
79
79
elif [ "${_op}" = rm ]\
80
80
&& ex_rtl_fileop test "${1}"; then
81
- ex_rtl_log_msg vvvo "Removing directory or file \`${1}'.";
81
+ ex_rtl_log_msg vvvv "Removing directory or file \`${1}'.";
82
82
exp_rtl_fileop_check "${PREFIX}" "${1}";
83
83
rm -rf -- "${1}";
84
84
elif [ "${_op}" = source_opt ]\
85
85
&& ex_rtl_fileop test "${1}"; then
86
- ex_rtl_log_msg vvvo "Sourcing file \`${1}'.";
86
+ ex_rtl_log_msg vvvv "Sourcing file \`${1}'.";
87
87
exp_rtl_fileop_check "${PREFIX}" "${1}";
88
88
. "${1}";
89
89
elif [ "${_op}" = test ]\
90
90
&& ! [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then
91
91
return 1;
92
92
elif [ "${_op}" = touch ]; then
93
- ex_rtl_log_msg vvvo "Touching file \`${1}'.";
93
+ ex_rtl_log_msg vvvv "Touching file \`${1}'.";
94
94
exp_rtl_fileop_check "${PREFIX}" "${1}";
95
95
touch -- "${1}";
96
96
fi; shift;
file modified
+3 -0
subr/ex_rtl_log.subr CHANGED
@@ -44,6 +44,9 @@ ex_rtl_log_msg() {
44
44
elif [ "${_lvl}" = vvvo ]\
45
45
&& [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 3 ]; then
46
46
return;
47
+ elif [ "${_lvl}" = vvvv ]\
48
+ && [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 4 ]; then
49
+ return;
47
50
fi;
48
51
_lvl_uc="$(ex_rtl_toupper "${_lvl%exit}")";
49
52
_attr="$(ex_rtl_get_var_unsafe "DEFAULT_LOG_MSG_${_lvl_uc}_COLOUR")";
file modified
+1 -0
vars/env.vars CHANGED
@@ -26,6 +26,7 @@ DEFAULT_LOG_MSG_VNFO_COLOUR=96;
26
26
DEFAULT_LOG_MSG_VUCC_COLOUR=90;
27
27
DEFAULT_LOG_MSG_VVFO_COLOUR=96;
28
28
DEFAULT_LOG_MSG_VVVO_COLOUR=96;
29
+ DEFAULT_LOG_MSG_VVVV_COLOUR=96;
29
30
DEFAULT_TIMESTAMP_FMT="%Y/%m/%d %H:%M:%S";
30
31
31
32
# vim:filetype=sh textwidth=0