From 88a957db9f041204e901cce3823ebd887c46db9f Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 20 Feb 2018 22:58:19 +0000 Subject: Fix RANDOMIZE_MASTER_SITES. - /usr/games/random moved to /usr/bin/random in 11.0+ - Need to explicitly add in the pipe '|' Approved by: portmgr (implicit) --- Mk/Scripts/do-fetch.sh | 7 ++++++- Mk/bsd.port.mk | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'Mk') diff --git a/Mk/Scripts/do-fetch.sh b/Mk/Scripts/do-fetch.sh index 6b1fba18dd1a..ee7566901000 100644 --- a/Mk/Scripts/do-fetch.sh +++ b/Mk/Scripts/do-fetch.sh @@ -112,7 +112,12 @@ for _file in "${@}"; do ;; esac sites_remaining=0 - sites="$(${SORTED_MASTER_SITES_CMD_TMP} ${dp_RANDOMIZE_SITES})" + if [ -n "${dp_RANDOMIZE_SITES}" ]; then + sites="$(${SORTED_MASTER_SITES_CMD_TMP} | ${dp_RANDOMIZE_SITES})" + else + sites="$(${SORTED_MASTER_SITES_CMD_TMP})" + fi + echo $sites >&2 for site in ${sites}; do sites_remaining=$((sites_remaining + 1)) done diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index de02b50fc18a..f2c4e924da9b 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -2110,8 +2110,12 @@ FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS} .if defined(RANDOMIZE_MASTER_SITES) .if exists(/usr/games/random) RANDOM_CMD?= /usr/games/random +.elif exists(/usr/bin/random) +RANDOM_CMD?= /usr/bin/random +.endif +.if defined(RANDOM_CMD) && !empty(RANDOM_CMD) RANDOM_ARGS?= -w -f - -_RANDOMIZE_SITES= |${RANDOM_CMD} ${RANDOM_ARGS} +_RANDOMIZE_SITES= ${RANDOM_CMD} ${RANDOM_ARGS} .endif .endif -- cgit