]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/bitbake: Only build tar-replacement-native when the build system tar version...
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 Jun 2011 14:07:23 +0000 (15:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 Jun 2011 15:32:03 +0000 (16:32 +0100)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/bitbake

index 39d5957078c199d39b7273a14173d7a2e89fd915..3923421cec06d394d5c9897622313a5e0c6561a9 100755 (executable)
@@ -16,10 +16,23 @@ done
 [ $needpseudo = "0" ] && break
 done
 
+needtar="1"
+TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4`
+float_test() {
+     echo | awk 'END { exit ( !( '"$1"')); }'
+}
+
+# Tar version 1.24 and onwards handle symlinks in sstate packages correctly
+# but earlier versions do not
+float_test "$TARVERSION > 1.23" && needtar="0"
+
 buildpseudo="1"
 if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
     PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
-    if [ -e "$PSEUDOBINDIR/pseudo" -a -e "$PSEUDOBINDIR/tar" ]; then
+    if [ -e "$PSEUDOBINDIR/pseudo" -a -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then
+        buildpseudo="0"
+    fi
+    if [ -e "$PSEUDOBINDIR/pseudo" -a $needtar = "0" ]; then
         buildpseudo="0"
     fi
 fi
@@ -32,7 +45,11 @@ export PATH=`echo $PATH | sed s#[^:]*/scripts:##`
 if [ $buildpseudo = "1" ]; then
     echo "Pseudo is not present but is required, building this first before the main build"
     export PSEUDO_BUILD=1
-    bitbake pseudo-native tar-replacement-native -c populate_sysroot
+    TARTARGET="tar-replacement-native"
+    if [ $needtar = "0" ]; then
+        TARTARGET=""
+    fi
+    bitbake pseudo-native $TARTARGET -c populate_sysroot
     ret=$?
     if [ "$ret" != "0" ]; then
         exit 1