Skip to contentSkip to conversation

tools: improve portability of imx_cntr_image.sh

PATCH New Martin Husemann 2 participants 2 messages Nov 9, 2018 – Dec 8, 2018 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: improve portability of imx_cntr_image.sh

Replace non-portable operator == with =

The operator == in sh(1) / test(1) is non-POSIX and only implemented by some shells (like bash). It is equivalent to the standard defined operator =.

---
 tools/imx_cntr_image.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/imx_cntr_image.sh +1 -1
index 4c629e8694..972b95ccbe 100755
@@ -10,7 +10,7 @@ file=$1
 blobs=`awk '/^APPEND/ {print $2} /^IMAGE/ || /^DATA/ {print $3}' $file`
 for f in $blobs; do
 	tmp=$srctree/$f
-	if [ $f == "u-boot-dtb.bin" ]; then
+	if [ $f = "u-boot-dtb.bin" ]; then
 		continue
 	fi
 
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 tools: improve portability of imx_cntr_image.sh

Quoted 15 lines · Martin Husemann

Replace non-portable operator == with =

The operator == in sh(1) / test(1) is non-POSIX and only implemented by some shells (like bash). It is equivalent to the standard defined operator =.

---
 tools/imx_cntr_image.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/imx_cntr_image.sh +0 -0
index 4c629e8694..972b95ccbe 100755

tools/imx_cntr_image.sh file=$1 · line 16

Quoted 8 lines
tools/imx_cntr_image.sh +1 -1
@@ -10,7 +10,7 @@ file=$1
 blobs=`awk '/^APPEND/ {print $2} /^IMAGE/ || /^DATA/ {print $3}' $file`
 for f in $blobs; do
 	tmp=$srctree/$f
-	if [ $f == "u-boot-dtb.bin" ]; then
+	if [ $f = "u-boot-dtb.bin" ]; then
 		continue
 	fi
 

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================