]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/bitbake: remove bashisms
authorJoshua Lock <josh@linux.intel.com>
Mon, 31 Jan 2011 11:38:35 +0000 (11:38 +0000)
committerJoshua Lock <josh@linux.intel.com>
Mon, 31 Jan 2011 11:38:35 +0000 (11:38 +0000)
As the BitBake script is the initial entry point for the system we need to
ensure it can run in as many places as possible, including systems which
aren't yest optimally configured for running Poky.
Remove some bashisms from the script so that it can run under Dash.

Pointers from: https://wiki.ubuntu.com/DashAsBinSh
Errors before this patch: http://pastie.org/1502136

Signed-off-by: Joshua Lock <josh@linux.intel.com>
scripts/bitbake

index 55bc8fd437361f3c01164367b355a5856a66114b..f40bd282609b261523068f67bc97ee49064037fc 100755 (executable)
@@ -3,29 +3,29 @@ NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --envir
 needpseudo="1"
 for opt in $@; do
 for key in $NO_BUILD_OPTS; do
-    if [ $opt == $key ]
+    if [ $opt = $key ]
     then
         needpseudo="0"
         break
     fi
 done
-[ $needpseudo == "0" ] && break
+[ $needpseudo = "0" ] && break
 done
 
 buildpseudo="1"
-if [ $needpseudo == "1" -a -e "$BUILDDIR/pseudodone" ]; then
+if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
     PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
     if [ -e "$PSEUDOBINDIR/pseudo" ]; then
         buildpseudo="0"
     fi
 fi
-if [ $needpseudo == "0" ]; then
+if [ $needpseudo = "0" ]; then
     buildpseudo="0"
 fi
 
 OLDPATH=$PATH
 export PATH=`echo $PATH | sed s#[^:]*/scripts:##`
-if [ $buildpseudo == "1" ]; then
+if [ $buildpseudo = "1" ]; then
     echo "Pseudo is not present but is required, building this first before the main build"
     bitbake pseudo-native -c populate_sysroot
     ret=$?
@@ -43,7 +43,7 @@ if [ $buildpseudo == "1" ]; then
 fi
 BITBAKE=`which bitbake`
 export PATH=$OLDPATH
-if [ $needpseudo == "1" ]; then
+if [ $needpseudo = "1" ]; then
     PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
     PSEUDO_BINDIR=$PSEUDOBINDIR PSEUDO_LIBDIR=$PSEUDOBINDIR/../lib/pseudo/lib PSEUDO_PREFIX=$PSEUDOBINDIR/../../ PSEUDO_DISABLED=1 $PSEUDOBINDIR/pseudo $BITBAKE $@
 else