summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-03-27 16:57:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-28 09:34:12 +0100
commitf79184d4000708020f76d82330428b5e7a803642 (patch)
tree7bbf0fbff5218e1fd0bd733643f9f8f5d327d15d
parent0b007519fcfb1bcf2be9cad40b0f6265f8798518 (diff)
downloadopenembedded-core-f79184d4000708020f76d82330428b5e7a803642.tar.gz
openembedded-core-f79184d4000708020f76d82330428b5e7a803642.tar.bz2
openembedded-core-f79184d4000708020f76d82330428b5e7a803642.tar.xz
openembedded-core-f79184d4000708020f76d82330428b5e7a803642.zip
scripts/bitbake: Update to help rebuild pseudo-native
Attempt to detect when pseudo-native has been updated. If it has been updated, or if the user is attempting an operation with pseudo-native in the name, force a build of pseudo-native, prior to running the main build. Note: This causes a build, then clean in the case of bitbake -c cleansstate pseudo-native Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/bitbake36
1 files changed, 31 insertions, 5 deletions
diff --git a/scripts/bitbake b/scripts/bitbake
index 45c869799..eb9e14fae 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -55,21 +55,47 @@ fi
buildpseudo="1"
if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
- if [ -e "$PSEUDOBINDIR/pseudo" -a -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then
+ if [ -e "$PSEUDOBINDIR/pseudo" ]; then
buildpseudo="0"
fi
- if [ -e "$PSEUDOBINDIR/pseudo" -a $needtar = "0" ]; then
- buildpseudo="0"
+
+ # Verify that the pseudo recipes are older then the pseudodone file
+ PSEUDO_RECIPE="`dirname $0`/../meta/recipes-devtools/pseudo"
+ if [ $buildpseudo -eq 0 ] && [ ! -d "$PSEUDO_RECIPE" ]; then
+ echo "Unable to verify if pseudo-native is up to date..." >&2
+ elif [ $buildpseudo -eq 0 ]; then
+ PSEUDO_NEWER=`find $PSEUDO_RECIPE -type f -newer $BUILDDIR/pseudodone`
+ if [ -n "$PSEUDO_NEWER" ]; then
+ buildpseudo="2"
+ fi
fi
fi
+
+# If tar is already built, we don't want to do it again...
+if [ -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then
+ needtar="0"
+fi
+
if [ $needpseudo = "0" ]; then
buildpseudo="0"
fi
+# If pseudo-native is an argument, assume the user wants to build pseudo-native!
+if [ $needpseudo != "0" -a $buildpseudo -eq 0 ]; then
+ for opt in $@; do
+ if [ "$opt" = "pseudo-native" ]; then
+ buildpseudo="3"
+ break
+ fi
+ done
+fi
+
OLDPATH=$PATH
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"
+if [ $buildpseudo -gt 0 ]; then
+ [ $buildpseudo -eq 1 ] && echo "Pseudo is not present but is required, building this first before the main build"
+ [ $buildpseudo -eq 2 ] && echo "Pseudo may be out of date, rebuilding pseudo before the main build"
+ [ $buildpseudo -eq 3 ] && echo "Building pseudo-native before main build"
export PSEUDO_BUILD=1
TARTARGET="tar-replacement-native"
if [ $needtar = "0" ]; then