From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] scripts/bitbake: Drop horrible double execution mess
Date: Fri, 07 Jun 2013 18:17:49 +0100 [thread overview]
Message-ID: <1370625469.6864.62.camel@ted> (raw)
There is no longer anything of value in the bitbake wrapper script since pseudo
is handled by bitbake internally. We can therefore drop it (yay).
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/scripts/bitbake b/scripts/bitbake
deleted file mode 100755
index dde61c4..0000000
--- a/scripts/bitbake
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/sh
-
-# This is the bitbake wrapper script that ensures everything is set up
-# correctly in the environment, builds pseudo separately if it hasn't
-# already been built, and then runs bitbake within pseudo.
-
-export BBFETCH2=True
-export BB_ENV_EXTRAWHITE="PSEUDO_BUILD PSEUDO_DISABLED $BB_ENV_EXTRAWHITE"
-
-# For certain operations (i.e. that won't be actually running any tasks)
-# we don't need pseudo
-NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --environment -g --graphviz"
-
-# Some options are useful to pass through to the initial pseudo build if
-# that needs to be run (for debugging)
-PASSTHROUGH_OPTS="-D -DD -DDD -DDDD -v"
-
-needpseudo="1"
-for opt in $@; do
-for key in $NO_BUILD_OPTS; do
- if [ $opt = $key ]
- then
- needpseudo="0"
- break
- fi
-done
-[ $needpseudo = "0" ] && break
-done
-
-if [ ! -e conf/bblayers.conf ] ; then
- BDPRINT=""
- [ -n "$BUILDDIR" ] && BDPRINT=": $BUILDDIR"
- echo "Unable to find conf/bblayers.conf"
- echo "BitBake must be run from within your build directory$BDPRINT"
- exit 1
-elif [ -z "$BUILDDIR" ] ; then
- BUILDDIR="`pwd`"
-fi
-
-buildpseudo="1"
-if [ $needpseudo = "1" ]; then
- if [ -e "$BUILDDIR/pseudodone" ]; then
- PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
- else
- PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
- fi
- if [ -e "$PSEUDOBINDIR/pseudo" ]; then
- buildpseudo="0"
- fi
-
- # 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
- if [ $buildpseudo = "0" -a ! -e "$BUILDDIR/pseudodone" ] ; then
- echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
- fi
-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:##g`
-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
-
- # Pass through debug options
- additionalopts=""
- for opt in $@; do
- for key in $PASSTHROUGH_OPTS; do
- if [ $opt = $key ]
- then
- additionalopts="$additionalopts $opt"
- break
- fi
- done
- done
-
- bitbake pseudo-native $additionalopts -c populate_sysroot
- ret=$?
- if [ "$ret" != "0" ]; then
- exit 1
- fi
- PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
- ret=$?
- if [ "$ret" != "0" ]; then
- exit 1
- fi
- echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
- # This needs to exist in case pseudo has to log somewhere
- mkdir -p $PSEUDOBINDIR/../../var/pseudo
-fi
-BITBAKE=`which bitbake`
-export PATH=$OLDPATH
-if [ $needpseudo = "1" ]; then
- export PSEUDO_BUILD=2
- PSEUDO_BINDIR=$PSEUDOBINDIR PSEUDO_LIBDIR=$PSEUDOBINDIR/../lib/pseudo/lib PSEUDO_PREFIX=$PSEUDOBINDIR/../../ PSEUDO_DISABLED=1 $PSEUDOBINDIR/pseudo $BITBAKE $@
-else
- export PSEUDO_BUILD=0
- $BITBAKE $@
-fi
-ret=$?
-exit $ret
reply other threads:[~2013-06-07 17:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370625469.6864.62.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.