From 22d13912cfe1a45813eda153ade22541c208fcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 5 Apr 2021 09:27:49 +0100 Subject: pkgtool.sh:pkgtool{,p_mirror}(): split -m , into -m -M for convenience. subr/pkgtool_init.subr: split -m , into -m -M for convenience. etc/{pkgtool.usage,README.md}: updated. --- subr/pkgtool_init.subr | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'subr') diff --git a/subr/pkgtool_init.subr b/subr/pkgtool_init.subr index b33795ee..00a7367b 100644 --- a/subr/pkgtool_init.subr +++ b/subr/pkgtool_init.subr @@ -5,11 +5,11 @@ pkgtoolp_init_args() { local _rc=0; _status=""; if [ "$((${ARG_INFO:-0} + ${ARG_MIRROR:-0} + ${ARG_RDEPENDS:-0} + ${ARG_SHELL:-0} + ${ARG_TARBALL:-0}))" -gt 1 ]; then - cat etc/pkgtool.usage; _rc=1; _status="Error: only one of -i, -r, -s, or -t must be specified."; + cat etc/pkgtool.usage; _rc=1; _status="Error: only one of -i, -m and/or -M, -r, -s, or -t must be specified."; elif [ "$((${ARG_INFO:-0} + ${ARG_MIRROR:-0} + ${ARG_RDEPENDS:-0} + ${ARG_SHELL:-0} + ${ARG_TARBALL:-0}))" -eq 0 ]\ && [ -z "${ARG_RESTART_AT}" ]\ && [ "${ARG_UPDATE_DIFF:-0}" -eq 0 ]; then - cat etc/pkgtool.usage; _rc=1; _status="Error: one of -i, -m, -r, -s, or -t must be specified."; + cat etc/pkgtool.usage; _rc=1; _status="Error: one of -i, -m and/or -M, -r, -s, or -t must be specified."; else _rc=0; export TMP="${BUILD_WORKDIR}" TMPDIR="${BUILD_WORKDIR}"; fi; return "${_rc}"; }; @@ -30,7 +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_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; while [ "${#}" -gt 0 ]; do case "${1}" in --update-diff) @@ -48,13 +49,14 @@ pkgtoolp_init_getopts() { break; elif [ "${_shiftfl:-0}" -gt 0 ]; then shift "${_shiftfl}"; continue; - elif getopts a:b:him:rst _opt; then + elif getopts a:b:him:M:rst _opt; then case "${_opt}" in a) ARCH="${OPTARG}"; ;; b) BUILD_KIND="${OPTARG}"; ;; h) cat etc/pkgtool.usage; exit 0; ;; i) ARG_INFO=1; ;; m) ARG_MIRROR=1; ARG_MIRROR_DNAME="${OPTARG}"; ;; + M) ARG_MIRROR=1; ARG_MIRROR_DNAME_GIT="${OPTARG}"; ;; r) ARG_RDEPENDS=1; ;; s) ARG_SHELL=1; ;; t) ARG_TARBALL=1; ;; -- cgit v1.2.3