From f3562be2bbdcf4bd4ccf17bf453dcc23dc25c639 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: Tue, 30 May 2017 20:41:26 +0000 Subject: build.sh, etc/build.usage: adds -[46]: force IPv[46] when downloading. subr/pre_setup_env.subr: prepend -4 or -6 to ${WGET_ARGS} when -[46] was specified. --- build.sh | 2 ++ etc/build.usage | 6 ++++-- subr/pre_setup_env.subr | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index c7e3c0b1..1a86b63a 100755 --- a/build.sh +++ b/build.sh @@ -9,6 +9,8 @@ for __ in subr/*.subr; do . "${__}"; done; set -o noglob; while [ ${#} -gt 0 ]; do case ${1} in +-4) ARG_IPV4_ONLY=1; ;; +-6) ARG_IPV6_ONLY=1; ;; -c) ARG_CLEAN=1; ;; -C) ARG_CHECK_UPDATES=1; ;; -N) ARG_OFFLINE=1; ;; diff --git a/etc/build.usage b/etc/build.usage index 4afb4504..18be3f4b 100644 --- a/etc/build.usage +++ b/etc/build.usage @@ -1,7 +1,9 @@ -usage: ./build.sh [-x] [-a nt32|nt64] [-b debug|release] [-c] [-C] [-h] - [-i] [-N] [-r package[,...][:step]] [-R] [-t[.gz|.bz2|.xz] +usage: ./build.sh [-x] [-4] [-6] [-a nt32|nt64] [-b debug|release] [-c] [-C] + [-h] [-i] [-N] [-r package[,...][:step]] [-R] [-t[.gz|.bz2|.xz] [-v] [[ ...]] -x Set the xtrace sh(1)ell option for debugging purposes. + -4 Force IPv4 when downloading files. + -6 Force IPv6 when downloading files. -a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64. -b debug|release Selects debug or release build; defaults to debug. This currently only controls CFLAGS. diff --git a/subr/pre_setup_env.subr b/subr/pre_setup_env.subr index b8e1faa6..d5de2772 100644 --- a/subr/pre_setup_env.subr +++ b/subr/pre_setup_env.subr @@ -11,6 +11,11 @@ pre_setup_env() { for __ in ${HOME}/midipix_build.vars ../midipix_build.vars ./vars/build.vars; do [ -e ${__} ] && . ${__}; done; + if [ ${ARG_IPV4_ONLY:-0} -eq 1 ]; then + WGET_ARGS="-4${WGET_ARGS:+ ${WGET_ARGS}}"; + elif [ ${ARG_IPV6_ONLY:-0} -eq 1 ]; then + WGET_ARGS="-6${WGET_ARGS:+ ${WGET_ARGS}}"; + fi; for __ in $(export | sed -e 's/^export //' -e 's/=.*$//'); do if ! lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then unset "${__}"; -- cgit v1.2.3