diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2018-02-21 06:58:19 +0800 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2018-02-21 06:58:19 +0800 |
commit | 88a957db9f041204e901cce3823ebd887c46db9f (patch) | |
tree | b95ee5d81682f3d6db4bf946364466b9077a4533 /Mk | |
parent | a42514a78e4f12f24a6c5ed5edf4ef1b187d8af2 (diff) | |
download | freebsd-ports-gnome-88a957db9f041204e901cce3823ebd887c46db9f.tar.gz freebsd-ports-gnome-88a957db9f041204e901cce3823ebd887c46db9f.tar.zst freebsd-ports-gnome-88a957db9f041204e901cce3823ebd887c46db9f.zip |
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)
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Scripts/do-fetch.sh | 7 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 6 |
2 files changed, 11 insertions, 2 deletions
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 |