From owner-svn-ports-all@freebsd.org Fri Jun 8 09:26:22 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 451691015B77; Fri, 8 Jun 2018 09:26:22 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC4657A983; Fri, 8 Jun 2018 09:26:21 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB33D53AD; Fri, 8 Jun 2018 09:26:21 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w589QL7K044064; Fri, 8 Jun 2018 09:26:21 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w589QKTX044059; Fri, 8 Jun 2018 09:26:20 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201806080926.w589QKTX044059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Fri, 8 Jun 2018 09:26:20 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r471988 - head/Mk/Scripts X-SVN-Group: ports-head X-SVN-Commit-Author: mat X-SVN-Commit-Paths: head/Mk/Scripts X-SVN-Commit-Revision: 471988 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 09:26:22 -0000 Author: mat Date: Fri Jun 8 09:26:20 2018 New Revision: 471988 URL: https://svnweb.freebsd.org/changeset/ports/471988 Log: SC2046: Quote this to prevent word splitting. When command expansions are unquoted, word splitting and globbing will occur. This often manifests itself by breaking when filenames contain spaces. Trying to fix it by adding quotes or escapes to the data will not work. Instead, quote the command substitution itself. If the command substitution outputs multiple pieces of data, use a loop instead. Add an exception when using set -- where splitting is intended. PR: 227109 Submitted by: mat Exp-run by: antoine Sponsored by: Absolight Modified: head/Mk/Scripts/check_leftovers.sh (contents, props changed) head/Mk/Scripts/depends-list.sh (contents, props changed) head/Mk/Scripts/find-lib.sh (contents, props changed) head/Mk/Scripts/functions.sh (contents, props changed) head/Mk/Scripts/smart_makepatch.sh (contents, props changed) Modified: head/Mk/Scripts/check_leftovers.sh ============================================================================== --- head/Mk/Scripts/check_leftovers.sh Fri Jun 8 09:04:27 2018 (r471987) +++ head/Mk/Scripts/check_leftovers.sh Fri Jun 8 09:26:20 2018 (r471988) @@ -45,7 +45,7 @@ fi if [ -z "${CCACHE_DIR}" ]; then CCACHE_DIR=$(make -C ${portdir} -VCCACHE_DIR) fi -homedirs=$(awk -F: -v users=$(make -C ${portdir} -V USERS|sed -e 's, ,|,g;/^$/d;s,^,^(,;s,$,)$,') 'users && $1 ~ users {print $9}' ${PORTSDIR}/UIDs|sort -u|sed -e "s|/usr/local|${PREFIX}|"|tr "\n" " ") +homedirs=$(awk -F: -v users="$(make -C ${portdir} -V USERS|sed -e 's, ,|,g;/^$/d;s,^,^(,;s,$,)$,')" 'users && $1 ~ users {print $9}' ${PORTSDIR}/UIDs|sort -u|sed -e "s|/usr/local|${PREFIX}|"|tr "\n" " ") plistsub_sed=$(make -C ${portdir} -VPLIST_SUB_SED | /bin/sh ${PORTSDIR}/Mk/Scripts/plist_sub_sed_sort.sh) tmpplist=$(make -C ${portdir} -VTMPPLIST) Modified: head/Mk/Scripts/depends-list.sh ============================================================================== --- head/Mk/Scripts/depends-list.sh Fri Jun 8 09:04:27 2018 (r471987) +++ head/Mk/Scripts/depends-list.sh Fri Jun 8 09:26:20 2018 (r471988) @@ -101,10 +101,14 @@ check_dep() { # Grab any needed vars from the port. if [ ${requires_wrkdir} -eq 1 ]; then + # shellcheck disable=SC2046 + # We want word splitting here. set -- $(${dp_MAKE} -C ${d} -VWRKDIR -V_UNIFIED_DEPENDS) wrkdir="$1" shift elif [ ${recursive} -eq 1 ]; then + # shellcheck disable=SC2046 + # We want word splitting here. set -- $(${dp_MAKE} -C ${d} -V_UNIFIED_DEPENDS) fi Modified: head/Mk/Scripts/find-lib.sh ============================================================================== --- head/Mk/Scripts/find-lib.sh Fri Jun 8 09:04:27 2018 (r471987) +++ head/Mk/Scripts/find-lib.sh Fri Jun 8 09:26:20 2018 (r471988) @@ -27,7 +27,7 @@ dirs="${LIB_DIRS} $(cat ${LOCALBASE}/libdata/ldconfig/ for libdir in ${dirs} ; do test -f ${libdir}/${lib} || continue libfile=${libdir}/${lib} - [ $(file -b -L --mime-type ${libfile}) = "application/x-sharedlib" ] || continue + [ "$(file -b -L --mime-type ${libfile})" = "application/x-sharedlib" ] || continue echo $libfile break done Modified: head/Mk/Scripts/functions.sh ============================================================================== --- head/Mk/Scripts/functions.sh Fri Jun 8 09:04:27 2018 (r471987) +++ head/Mk/Scripts/functions.sh Fri Jun 8 09:26:20 2018 (r471988) @@ -188,8 +188,8 @@ export_ports_env() { done # Bring in all the vars, but not empty ones. - eval $(${MAKE} -f ${PORTSDIR}/Mk/bsd.port.mk ${make_cmd} \ - USES="${uses}" | grep -v '=$' | sed -e 's,\\ $,,') + eval "$(${MAKE} -f ${PORTSDIR}/Mk/bsd.port.mk ${make_cmd} \ + USES="${uses}" | grep -v '=$' | sed -e 's,\\ $,,')" for var in ${export_vars}; do # Export and display non-empty ones. This is not redundant # with above since we're looping on all vars here; do not Modified: head/Mk/Scripts/smart_makepatch.sh ============================================================================== --- head/Mk/Scripts/smart_makepatch.sh Fri Jun 8 09:04:27 2018 (r471987) +++ head/Mk/Scripts/smart_makepatch.sh Fri Jun 8 09:26:20 2018 (r471988) @@ -63,7 +63,7 @@ std_patch_filename() { local raw_name sans_cwd=$(echo $1 | sed 's|^\.\/||') raw_name=$(strip_path ${sans_cwd}) - echo patch-$(echo ${raw_name} | sed -e 's|_|&&|g; s|/|_|g') + echo "patch-$(echo ${raw_name} | sed -e 's|_|&&|g; s|/|_|g')" } patchdir_files_list() {