summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-04-05 09:51:27 +0100
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-04-05 09:51:27 +0100
commit5cca78ff4955b2267f69409bf1c4c6cd627a93e6 (patch)
tree90f2c99909a4b0ad8d7f02229b53c865ef5f9caf /subr
parent5daef9b642a90d0e4e15af397d8c4002c31abdd3 (diff)
downloadmidipix_build-5cca78ff4955b2267f69409bf1c4c6cd627a93e6.tar.bz2
midipix_build-5cca78ff4955b2267f69409bf1c4c6cd627a93e6.tar.xz
pkgtool.sh:pkgtoolp_mirror_fetch(), subr/pkgtool_init.subr: implement and honour -v.
etc/{pkgtool.usage,README.md}: updated.
Diffstat (limited to 'subr')
-rw-r--r--subr/pkgtool_init.subr12
1 files changed, 9 insertions, 3 deletions
diff --git a/subr/pkgtool_init.subr b/subr/pkgtool_init.subr
index 00a7367b..b7c04c70 100644
--- a/subr/pkgtool_init.subr
+++ b/subr/pkgtool_init.subr
@@ -30,8 +30,8 @@ pkgtoolp_init_env() {
pkgtoolp_init_getopts() {
local _opt="" _shiftfl=0 _rc=0 OPTIND=0; _status=""; : ${ARCH:="nt64"}; : ${BUILD_KIND:="debug"};
- ARG_INFO=0; ARG_MIRROR=0; ARG_MIRROR_DNAME=""; ARG_MIRROR_DNAME_GIT="";
- ARG_RESTART_AT=""; ARG_RDEPENDS=0; ARG_UPDATE_DIFF=0; ARG_SHELL=0; ARG_TARBALL=0;
+ ARG_INFO=0; ARG_MIRROR=0; ARG_MIRROR_DNAME=""; ARG_MIRROR_DNAME_GIT=""; ARG_RESTART_AT="";
+ ARG_RDEPENDS=0; ARG_UPDATE_DIFF=0; ARG_SHELL=0; ARG_TARBALL=0; ARG_VERBOSE=0;
while [ "${#}" -gt 0 ]; do
case "${1}" in
--update-diff)
@@ -49,7 +49,7 @@ pkgtoolp_init_getopts() {
break;
elif [ "${_shiftfl:-0}" -gt 0 ]; then
shift "${_shiftfl}"; continue;
- elif getopts a:b:him:M:rst _opt; then
+ elif getopts a:b:him:M:rstv _opt; then
case "${_opt}" in
a) ARCH="${OPTARG}"; ;;
b) BUILD_KIND="${OPTARG}"; ;;
@@ -60,6 +60,7 @@ pkgtoolp_init_getopts() {
r) ARG_RDEPENDS=1; ;;
s) ARG_SHELL=1; ;;
t) ARG_TARBALL=1; ;;
+ v) ARG_VERBOSE=1; ;;
*) cat etc/pkgtool.usage; exit 1; ;;
esac; shift $((${OPTIND}-1)); OPTIND=1;
else case "${1}" in
@@ -73,6 +74,11 @@ pkgtoolp_init_getopts() {
&& [ "${ARG_MIRROR:-0}" -eq 0 ]; then
_rc=1; _status="Error: missing package name.";
else export PKGTOOL_PKG_NAME;
+ case "${ARG_VERBOSE:-0}" in
+ 0) rtl_fileop_set_log 0; rtl_log_set_lvl 0; ;;
+ 1) rtl_fileop_set_log 0; rtl_log_set_lvl 2; ;;
+ *) _rc=1; _status="Error: invalid verbosity level (max. -v)"; ;;
+ esac;
fi;
fi; return "${_rc}";
};