Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2018 16:20:39 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r471269 - head/Mk/Scripts
Message-ID:  <201806011620.w51GKdX4004064@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806011620.w51GKdX4004064>