diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2016-06-19 11:25:29 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2016-06-19 11:25:29 +0000 |
commit | a2262e931305294882ca078238da1ce88deba4bb (patch) | |
tree | 84c7cf412c9b595212c74612c2651e087a7a7203 | |
parent | 86cad8dff1ee6acc3f95e860c18e2ecebfc20d7f (diff) | |
download | freebsd-ports-a2262e931305294882ca078238da1ce88deba4bb.zip |
Remove unnecessary evals that do-fetch was using.
Turns out that env(1) knows how to parse a properly quoted string
using -S "string", it makes the double eval used for the fetch
command to be unnecessary.
This is because running:
eval "foo $(escape $bar)"
is silly when this works:
foo $bar
So remove escaping and quoting, and sillyness.
PR: 210198
Submitted by: mat
Exp-run by: antoine
Sponsored by: The FreeBSD Foundation, Absolight
Differential Revision: https://reviews.freebsd.org/D6779
-rw-r--r-- | Mk/Scripts/checksum.sh | 2 | ||||
-rw-r--r-- | Mk/Scripts/do-fetch.sh | 31 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 15 | ||||
-rw-r--r-- | games/narcissu2/Makefile | 2 | ||||
-rw-r--r-- | graphics/waifu2x-converter-cpp/Makefile | 2 | ||||
-rw-r--r-- | shells/ksh93/Makefile | 2 | ||||
-rw-r--r-- | sysutils/geomWatch/Makefile | 2 | ||||
-rw-r--r-- | textproc/kmfl-sil-ezra/Makefile | 4 | ||||
-rw-r--r-- | textproc/kmfl-sil-ipa-unicode/Makefile | 4 | ||||
-rw-r--r-- | textproc/kmfl-sil-panafrican-latin/Makefile | 4 | ||||
-rw-r--r-- | www/xpi-splash/Makefile | 2 |
11 files changed, 34 insertions, 36 deletions
diff --git a/Mk/Scripts/checksum.sh b/Mk/Scripts/checksum.sh index e9279b72e8bb..ba826ce9e9f3 100644 --- a/Mk/Scripts/checksum.sh +++ b/Mk/Scripts/checksum.sh @@ -28,7 +28,7 @@ if [ -f "${dp_DISTINFO_FILE}" ]; then eval "alg_executable=\$dp_${alg}" if [ "$alg_executable" != "NO" ]; then - MKSUM=$(eval $alg_executable \< "${file}") + MKSUM=$($alg_executable < "${file}") CKSUM=$(distinfo_data "${alg}" "${file}") else ignore="true" diff --git a/Mk/Scripts/do-fetch.sh b/Mk/Scripts/do-fetch.sh index ca28c86af120..c63fce5d81a6 100644 --- a/Mk/Scripts/do-fetch.sh +++ b/Mk/Scripts/do-fetch.sh @@ -22,7 +22,6 @@ cd "${dp_DISTDIR}" for _file in "${@}"; do file=${_file%%:*} - unescaped_file=$(unescape "${file}") # If this files has groups if [ "$_file" = "$file" ]; then @@ -43,7 +42,7 @@ for _file in "${@}"; do fi done fi - if [ ! -f "${unescaped_file}" -a ! -f "$filebasename" -o "$force_fetch" = "true" ]; then + if [ ! -f "${file}" -a ! -f "$filebasename" -o "$force_fetch" = "true" ]; then full_file="${dp_DIST_SUBDIR:+${dp_DIST_SUBDIR}/}${file}" if [ -L "$file" -o -L "$filebasename" ]; then ${dp_ECHO_MSG} "=> ${dp_DISTDIR}/$file is a broken symlink." @@ -71,7 +70,8 @@ for _file in "${@}"; do esac __MASTER_SITES_TMP= for group in $select; do - # Disable nounset for this, it may come up empty. + # Disable nounset for this, it may come up empty, but + # we don't want to fail with a strange error here. set +u eval ___MASTER_SITES_TMP="\${_${dp_SITE_FLAVOR}_SITES_${group}}" set -u @@ -104,32 +104,33 @@ for _file in "${@}"; do ;; esac sites_remaining=0 - sites="$(eval "${SORTED_MASTER_SITES_CMD_TMP} ${dp_RANDOMIZE_SITES}")" + sites="$(${SORTED_MASTER_SITES_CMD_TMP} ${dp_RANDOMIZE_SITES})" for site in ${sites}; do sites_remaining=$((sites_remaining + 1)) done for site in ${sites}; do sites_remaining=$((sites_remaining - 1)) CKSIZE=$(distinfo_data SIZE "${full_file}") - # The site may contain special shell characters, they - # need to be escaped. - site=$(escape "${site}") # There is a lot of escaping, but the " needs to survive echo/eval. case ${file} in */*) mkdir -p "${file%/*}" - args="-o \\\"${file}\\\" \\\"${site}${file}\\\"" + args="-o ${file} ${site}${file}" ;; *) - args="\\\"${site}${file}\\\"" + args="${site}${file}" ;; esac - _fetch_cmd=$(eval "echo ${dp_FETCH_ENV} ${dp_FETCH_CMD} ${dp_FETCH_BEFORE_ARGS} ${args} ${dp_FETCH_AFTER_ARGS}") + _fetch_cmd="${dp_FETCH_CMD} ${dp_FETCH_BEFORE_ARGS}" + if [ -z "${dp_DISABLE_SIZE}" -a -n "${CKSIZE}" ]; then + _fetch_cmd="${_fetch_cmd} -S ${CKSIZE}" + fi + _fetch_cmd="${_fetch_cmd} ${args} ${dp_FETCH_AFTER_ARGS}" case ${dp_TARGET} in do-fetch|makesum) ${dp_ECHO_MSG} "=> Attempting to fetch ${site}${file}" - if eval "env ${_fetch_cmd}"; then - actual_size=$(eval stat -f %z "${file}") + if env -S "${dp_FETCH_ENV}" ${_fetch_cmd}; then + actual_size=$(stat -f %z "${file}") if [ -n "${dp_DISABLE_SIZE}" ] || [ -z "${CKSIZE}" ] || [ "${actual_size}" -eq "${CKSIZE}" ]; then continue 2 else @@ -142,10 +143,10 @@ for _file in "${@}"; do fi ;; fetch-list) - echo -n "env ${_fetch_cmd} || " + echo -n "env $(escape "${_fetch_cmd}") || " ;; fetch-url-list-int) - eval "echo $(eval "echo ${args}")" + echo ${args} ;; esac done @@ -156,7 +157,7 @@ for _file in "${@}"; do exit 1 ;; fetch-list) - echo "echo ${file} not fetched; }" ; \ + echo "echo \"${file}\" not fetched; }" ; \ ;; esac fi diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index a764db1b06bc..dad780000f07 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -2057,9 +2057,6 @@ FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1 FETCH_BINARY?= /usr/bin/fetch FETCH_ARGS?= -Fpr FETCH_REGET?= 1 -.if !defined(DISABLE_SIZE) -FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE} -.endif FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS} .if defined(RANDOMIZE_MASTER_SITES) @@ -2471,24 +2468,24 @@ MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n; # # Hackery to enable simple fetch targets with several dynamic MASTER_SITES # -_MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}" +_MASTER_SITES_ENV= _MASTER_SITES_DEFAULT=${_MASTER_SITES_DEFAULT:Q} .for _F in ${DISTFILES} _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://} . if !empty(_F_TEMP) . for _group in ${_F_TEMP:S/,/ /g} . if defined(_MASTER_SITES_${_group}) -_MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}" +_MASTER_SITES_ENV+= _MASTER_SITES_${_group}=${_MASTER_SITES_${_group}:Q} . endif . endfor . endif .endfor -_PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}" +_PATCH_SITES_ENV= _PATCH_SITES_DEFAULT=${_PATCH_SITES_DEFAULT:Q} .for _F in ${PATCHFILES} _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://} . if !empty(_F_TEMP) . for _group in ${_F_TEMP:S/,/ /g} . if defined(_PATCH_SITES_${_group}) -_PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}" +_PATCH_SITES_ENV+= _PATCH_SITES_${_group}=${_PATCH_SITES_${_group}:Q} . endif . endfor . endif @@ -3029,7 +3026,7 @@ _DO_FETCH_ENV= \ dp_FETCH_AFTER_ARGS='${FETCH_AFTER_ARGS}' \ dp_FETCH_BEFORE_ARGS='${FETCH_BEFORE_ARGS}' \ dp_FETCH_CMD='${FETCH_CMD}' \ - dp_FETCH_ENV=${FETCH_ENV:Q:Q} \ + dp_FETCH_ENV=${FETCH_ENV:Q} \ dp_FORCE_FETCH_ALL='${FORCE_FETCH_ALL}' \ dp_FORCE_FETCH_LIST='${FORCE_FETCH_LIST}' \ dp_MASTER_SITE_BACKUP='${_MASTER_SITE_BACKUP}' \ @@ -3792,7 +3789,7 @@ pre-distclean: .if !target(distclean) distclean: pre-distclean clean - @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES} ${_PATCHFILES}" + @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES:Q} ${_PATCHFILES:Q}" .endif .if !target(delete-distfiles) diff --git a/games/narcissu2/Makefile b/games/narcissu2/Makefile index 794f0fd16d1a..9b5a2dd5aef7 100644 --- a/games/narcissu2/Makefile +++ b/games/narcissu2/Makefile @@ -5,7 +5,7 @@ PORTVERSION= 1.1 CATEGORIES= games MASTER_SITES= http://www.neechin.net/file_download/22/:game \ http://www.neechin.net/file_download/27/:script \ - https://aur.archlinux.org/cgit/aur.git/plain/${PORTNAME}-en.png?h=${PORTNAME}-en\&id=9768eea\&foo=/:icon + https://aur.archlinux.org/cgit/aur.git/plain/${PORTNAME}-en.png?h=${PORTNAME}-en&id=9768eea&foo=/:icon DISTFILES= [Denpa]_Narcissu_2_Eng_[unix].tar.bz2.link:game \ Narcissu_2_Eng_v${PORTVERSION}_script_[All_platforms].zip:script \ ${PORTNAME}-en.png:icon diff --git a/graphics/waifu2x-converter-cpp/Makefile b/graphics/waifu2x-converter-cpp/Makefile index aa4e92800b4b..db38dccdfb63 100644 --- a/graphics/waifu2x-converter-cpp/Makefile +++ b/graphics/waifu2x-converter-cpp/Makefile @@ -4,7 +4,7 @@ PORTNAME= waifu2x-converter-cpp DISTVERSION= 1.0.0-410 DISTVERSIONSUFFIX= -g5e5ac35 CATEGORIES= graphics -MASTER_SITES= https://aur.archlinux.org/cgit/aur.git/plain/${PORTNAME:C/-.*//}.1.gz?h=${PORTNAME:C/-.*//}-git\&id=5c150a5\&/:manpage +MASTER_SITES= https://aur.archlinux.org/cgit/aur.git/plain/${PORTNAME:C/-.*//}.1.gz?h=${PORTNAME:C/-.*//}-git&id=5c150a5&/:manpage DISTFILES= ${PORTNAME:C/-.*//}.1.gz:manpage EXTRACT_ONLY= ${DISTFILES:N*\:manpage:C/:.*//} diff --git a/shells/ksh93/Makefile b/shells/ksh93/Makefile index 86a25c56773b..f222a95524c9 100644 --- a/shells/ksh93/Makefile +++ b/shells/ksh93/Makefile @@ -26,7 +26,7 @@ LICENSE= EPL OPTIONS_DEFINE= EXAMPLES STATIC -FETCH_ENV= HTTP_AUTH='basic:*:I accept www.opensource.org/licenses/cpl:.' +FETCH_ENV= HTTP_AUTH=basic:*:I\ accept\ www.opensource.org/licenses/cpl:. LDFLAGS+= -lm MAKE_ENV= CCFLAGS="${CFLAGS}" NO_WRKSUBDIR= yes diff --git a/sysutils/geomWatch/Makefile b/sysutils/geomWatch/Makefile index e80aaa6a7cdc..1bd7eff2a5f7 100644 --- a/sysutils/geomWatch/Makefile +++ b/sysutils/geomWatch/Makefile @@ -9,7 +9,7 @@ MASTER_SITES= http://isis.poly.edu/~bk/${PORTNAME}/ \ http://bk.macroblock.net/${PORTNAME}/ \ http://svnweb.freebsd.org/base/head/sys/cddl/compat/opensolaris/sys/:nvpair DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ - nvpair.h\?revision=279437\&view=co:nvpair + nvpair.h?revision=279437&view=co:nvpair EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= spawk@acm.poly.edu diff --git a/textproc/kmfl-sil-ezra/Makefile b/textproc/kmfl-sil-ezra/Makefile index 454be3959daf..91be423f4f52 100644 --- a/textproc/kmfl-sil-ezra/Makefile +++ b/textproc/kmfl-sil-ezra/Makefile @@ -5,8 +5,8 @@ PORTNAME= kmfl-sil-ezra PORTVERSION= 2.4 PORTREVISION= 5 CATEGORIES= textproc -MASTER_SITES= http://scripts.sil.org/cms/scripts/render_download.php\?site_id=nrsi\&format=file\&media_id=EzraSIL251_Src.zip\&filename=/:1 \ - http://scripts.sil.org/cms/scripts/render_download.php\?site_id=nrsi\&format=file\&media_id=EzraSIL2.5Keying\&filename=/:2 \ +MASTER_SITES= http://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=EzraSIL251_Src.zip&filename=/:1 \ + http://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=EzraSIL2.5Keying&filename=/:2 \ http://anthesphoria.net/FreeBSD/ports/distfiles/${DIST_SUBDIR}/:1,2 DISTFILES= EzraSIL251_Src.zip:1 \ Keying+in+Hebrew.pdf:2 diff --git a/textproc/kmfl-sil-ipa-unicode/Makefile b/textproc/kmfl-sil-ipa-unicode/Makefile index 12aa2eafc5b6..b2268832f1a9 100644 --- a/textproc/kmfl-sil-ipa-unicode/Makefile +++ b/textproc/kmfl-sil-ipa-unicode/Makefile @@ -5,8 +5,8 @@ PORTNAME= kmfl-sil-ipa-unicode PORTVERSION= 1.2 PORTREVISION= 4 CATEGORIES= textproc -MASTER_SITES= http://scripts.sil.org/cms/scripts/render_download.php\?site_id=nrsi\&format=file\&media_id=IPAUni_12_Src\&filename=/:1 \ - http://scripts.sil.org/cms/scripts/render_download.php\?site_id=nrsi\&format=file\&media_id=IPAUni_12.pdf\&filename=/:2 +MASTER_SITES= http://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=IPAUni_12_Src&filename=/:1 \ + http://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=IPAUni_12.pdf&filename=/:2 DISTFILES= IPAUni_Src12.zip:1 \ IPA+Unicode+5.1_ver+1.2_KMN.pdf:2 DIST_SUBDIR= kmfl diff --git a/textproc/kmfl-sil-panafrican-latin/Makefile b/textproc/kmfl-sil-panafrican-latin/Makefile index 1b60c72e2928..87a7ad160d10 100644 --- a/textproc/kmfl-sil-panafrican-latin/Makefile +++ b/textproc/kmfl-sil-panafrican-latin/Makefile @@ -5,8 +5,8 @@ PORTNAME= kmfl-sil-panafrican-latin PORTVERSION= 20090831 PORTREVISION= 4 CATEGORIES= textproc -MASTER_SITES= http://scripts.sil.org/cms/scripts/render_download.php\?site_id=nrsi\&format=file\&media_id=AfricaKeyboardDead2009\&filename=/:1 \ - http://scripts.sil.org/cms/scripts/render_download.php\?site_id=nrsi\&format=file\&media_id=AfricaKeyboardUS2009\&filename=/:2 \ +MASTER_SITES= http://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=AfricaKeyboardDead2009&filename=/:1 \ + http://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=AfricaKeyboardUS2009&filename=/:2 \ http://anthesphoria.net/FreeBSD/ports/distfiles/${DIST_SUBDIR}/:1,2 DISTFILES= AfricaKeyboardDead.zip:1 AfricaKeyboardUS.zip:2 DIST_SUBDIR= kmfl diff --git a/www/xpi-splash/Makefile b/www/xpi-splash/Makefile index 61b534f757c0..0ec5253e4d15 100644 --- a/www/xpi-splash/Makefile +++ b/www/xpi-splash/Makefile @@ -9,7 +9,7 @@ CATEGORIES= www MAINTAINER= ports@FreeBSD.org COMMENT= Splash screen for most Mozilla and Mozilla Based products -XPI_DISTNAME= splash\! +XPI_DISTNAME= splash! XPI_ID= splash@aldreneo.com XPI_NUM= 2995 XPI_FILES= chrome/splash.jar components/.autoreg components/splash.js \ |