diff options
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | etc/build.usage | 6 | ||||
-rw-r--r-- | subr/pre_setup_env.subr | 5 |
3 files changed, 11 insertions, 2 deletions
@@ -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] [<target>[ ...]] -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 "${__}"; |