svn commit: r471269 - head/Mk/Scripts
Mathieu Arnold
mat at FreeBSD.org
Fri Jun 1 16:20:47 UTC 2018
Author: mat
Date: Fri Jun 1 16:20:39 2018
New Revision: 471269
URL: https://svnweb.freebsd.org/changeset/ports/471269
Log:
SC2163: Exporting an expansion rather than a variable.
export takes a variable name, but shellcheck has noticed that you give
it an expanded variable instead. The problematic code does not export
MYVAR but a variable called foo if any.
Add exception when using indirections where the variable to extract is
actually the value of the variable.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
Modified:
head/Mk/Scripts/functions.sh (contents, props changed)
Modified: head/Mk/Scripts/functions.sh
==============================================================================
--- head/Mk/Scripts/functions.sh Fri Jun 1 16:20:36 2018 (r471268)
+++ head/Mk/Scripts/functions.sh Fri Jun 1 16:20:39 2018 (r471269)
@@ -197,6 +197,8 @@ export_ports_env() {
value="$(eval echo \$${var})"
if [ -n "${value}" ]; then
+ # shellcheck disable=SC2163
+ # We want to export the variable which name is in var.
export ${var}
echo "export ${var}=\"${value}\""
fi
More information about the svn-ports-all
mailing list