[Intel-gfx] [PATCH 2/2] qf: Fix shell parameter expansion for the author name and email

Damien Lespiau damien.lespiau at intel.com
Wed Mar 5 19:51:46 CET 2014


A ':' was missing (should have been ':+'), but I think we want ':-', not
':+' ie we want to substitute if the parameter is undefined or empty:

  http://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 qf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/qf b/qf
index 057ae08..9838ffc 100755
--- a/qf
+++ b/qf
@@ -295,11 +295,11 @@ case "$1" in
 		quilt_clean_check
 
 		username=$GIT_COMMMITTER_NAME
-		username=${username+`git config user.name || true`}
-		username=${username+`getent passwd $USER | cut -d: -f 5 | cut -d, -f 1 || true`}
+		username=${username:-`git config user.name || true`}
+		username=${username:-`getent passwd $USER | cut -d: -f 5 | cut -d, -f 1 || true`}
 		useremail=$GIT_COMMMITTER_EMAIL
-		useremail=${useremail+`git config user.email || true`}
-		useremail=${useremail+$EMAIL}
+		useremail=${useremail:-`git config user.email || true`}
+		useremail=${useremail:-$EMAIL}
 
 		if [[ -z $useremail || -z $username ]] ; then
 			echo User name/email not found, please fix your config
-- 
1.8.3.1




More information about the Intel-gfx mailing list