Jelajahi Sumber

support/scripts/dependencies.sh: improve g++ test to avoid misleading output

When g++ is not installed, a misleading error message turns up because
of a bad combination of an unquoted shell variable and control flow.

 ~/buildroot$ make
 You may have to install 'g++' on your build machine
 /home/testuser/buildroot/support/dependencies/dependencies.sh: 136: [: -lt: unexpected operator

[Thomas:
  - fixed commit log, as per the suggestion of Yann E. Morin.
  - don't change existing empty new lines, suggested by Yann.
  - use positive logic in the newly added test, suggested by Yann.]

Signed-off-by: Jens Stimpfle <debian@jstimpfle.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Jens Stimpfle 10 tahun lalu
induk
melakukan
d1607dc7df
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 2 0
      support/dependencies/dependencies.sh

+ 2 - 0
support/dependencies/dependencies.sh

@@ -133,7 +133,9 @@ if [ ! -z "$CXXCOMPILER" ] ; then
 		echo
 		echo "You may have to install 'g++' on your build machine"
 	fi
+fi
 
+if [ -n "$CXXCOMPILER_VERSION" ] ; then
 	CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/\..*//g")
 	CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g")
 	if [ $CXXCOMPILER_MAJOR -lt 3 -o $CXXCOMPILER_MAJOR -eq 2 -a $CXXCOMPILER_MINOR -lt 95 ] ; then