svn commit: r471264 - head/Mk/Scripts

Mathieu Arnold mat at FreeBSD.org
Fri Jun 1 16:20:24 UTC 2018


Author: mat
Date: Fri Jun  1 16:20:22 2018
New Revision: 471264
URL: https://svnweb.freebsd.org/changeset/ports/471264

Log:
  SC2145: Argument mixes string and array. Use * or separate argument.
  
  The behavior when concatenating a string and array is rarely intended.
  The preceeding string is prefixed to the first array element, while the
  succeeding string is appended to the last one. The middle array elements
  are unaffected.
  
  For example, with the parameters foo,bar,baz, "--flag=$@" is equivalent
  to the three arguments "--flag=foo" "bar" "baz".
  
  PR:		227109
  Submitted by:	mat
  Sponsored by:	Absolight

Modified:
  head/Mk/Scripts/functions.sh   (contents, props changed)
  head/Mk/Scripts/generate-symbols.sh   (contents, props changed)
  head/Mk/Scripts/qa.sh   (contents, props changed)

Modified: head/Mk/Scripts/functions.sh
==============================================================================
--- head/Mk/Scripts/functions.sh	Fri Jun  1 15:30:57 2018	(r471263)
+++ head/Mk/Scripts/functions.sh	Fri Jun  1 16:20:22 2018	(r471264)
@@ -74,9 +74,9 @@ parse_plist() {
 		@info\ *|@shell\ *|@xmlcatmgr\ *)
 			set -- $line
 			shift
-			case "$@" in
-			/*) echo "${comment}$@" ;;
-			*) echo "${comment}${cwd}/$@" ;;
+			case "$*" in
+			/*) echo "${comment}$*" ;;
+			*) echo "${comment}${cwd}/$*" ;;
 			esac
 		;;
 		@sample\ *)
@@ -103,12 +103,12 @@ parse_plist() {
 		@fc\ *|@fcfontsdir\ *|@fontsdir\ *)
 			set -- $line
 			shift
-			case "$@" in
+			case "$*" in
 			/*)
-			echo >&3 "${comment}$@"
+			echo >&3 "${comment}$*"
 			;;
 			*)
-			echo >&3 "${comment}${cwd}/$@"
+			echo >&3 "${comment}${cwd}/$*"
 			;;
 			esac
 		;;

Modified: head/Mk/Scripts/generate-symbols.sh
==============================================================================
--- head/Mk/Scripts/generate-symbols.sh	Fri Jun  1 15:30:57 2018	(r471263)
+++ head/Mk/Scripts/generate-symbols.sh	Fri Jun  1 16:20:22 2018	(r471264)
@@ -3,7 +3,7 @@
 # Maintainer: portmgr at FreeBSD.org
 
 msg() {
-        echo "====> $@"
+        echo "====> $*"
 }
 
 msg "Finding symbols"

Modified: head/Mk/Scripts/qa.sh
==============================================================================
--- head/Mk/Scripts/qa.sh	Fri Jun  1 15:30:57 2018	(r471263)
+++ head/Mk/Scripts/qa.sh	Fri Jun  1 16:20:22 2018	(r471264)
@@ -13,15 +13,15 @@ LF=$(printf '\nX')
 LF=${LF%X}
 
 notice() {
-	echo "Notice: $@" >&2
+	echo "Notice: $*" >&2
 }
 
 warn() {
-	echo "Warning: $@" >&2
+	echo "Warning: $*" >&2
 }
 
 err() {
-	echo "Error: $@" >&2
+	echo "Error: $*" >&2
 }
 
 list_stagedir_elfs() {
@@ -31,7 +31,7 @@ list_stagedir_elfs() {
 shebangonefile() {
 	local f interp interparg badinterp rc
 
-	f="$@"
+	f="$*"
 	rc=0
 
 	# whitelist some files


More information about the svn-ports-all mailing list