diff options
author | Ross Burton <ross.burton@intel.com> | 2013-08-14 15:13:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-16 11:14:33 +0100 |
commit | ca367d02fde01bebc37666a05341a91d6b1366cc (patch) | |
tree | e857c378268ffbcf99f591277b9968ebacf53989 /scripts | |
parent | 969f4edcf939d191b1cc30df668294a66199d4b3 (diff) | |
download | poky-ca367d02fde01bebc37666a05341a91d6b1366cc.tar.gz |
wipe-sysroots: don't assume TMPDIR is under BUILDDIR
The previous code used the environment variable BUILDDIR and assumed that TMPDIR
was a subdirectory. This often isn't the case, so instead ask bitbake where the
directories we're about to delete are.
(From OE-Core rev: 29491a72acac81ebb7e9ecfbc9392fbeb9a7ea26)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/wipe-sysroot | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/scripts/wipe-sysroot b/scripts/wipe-sysroot index e751a91e92..2d2cbeac8c 100755 --- a/scripts/wipe-sysroot +++ b/scripts/wipe-sysroot | |||
@@ -18,17 +18,27 @@ | |||
18 | # along with this program; if not, write to the Free Software | 18 | # along with this program; if not, write to the Free Software |
19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | 20 | ||
21 | if [ -z "$BUILDDIR" ]; then | 21 | set -e |
22 | echo >&2 "Error: BUILDDIR is not defined, please initialise the build system." | 22 | |
23 | return 1 | 23 | ENVS=`mktemp --suffix -wipe-sysroot-envs` |
24 | bitbake -p -e > $ENVS | ||
25 | |||
26 | eval `grep -F SSTATE_MANIFESTS= $ENVS` | ||
27 | eval `grep -F STAGING_DIR= $ENVS` | ||
28 | eval `grep -F STAMPS_DIR= $ENVS` | ||
29 | rm -f $ENVS | ||
30 | |||
31 | if [ -z "$SSTATE_MANIFESTS" -o -z "$STAGING_DIR" -o -z "$STAMPS_DIR" ]; then | ||
32 | echo "Could not determine SSTATE_MANIFESTS/STAGING_DIR/STAMPS_DIR, check above for errors" | ||
33 | exit 1 | ||
24 | fi | 34 | fi |
25 | 35 | ||
26 | # The sysroots themselves | 36 | # The sysroots themselves |
27 | rm -rf $BUILDDIR/tmp/sysroots/ | 37 | rm -rf "$STAGING_DIR" |
28 | 38 | ||
29 | # The stamps that said the sysroot was populated | 39 | # The stamps that said the sysroot was populated |
30 | rm -rf $BUILDDIR/tmp/stamps/*/*/*.do_populate_sysroot.* | 40 | rm -rf "$STAMPS_DIR/*/*/*.do_populate_sysroot.*" |
31 | rm -rf $BUILDDIR/tmp/stamps/*/*/*.do_populate_sysroot_setscene.* | 41 | rm -rf "$STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*" |
32 | 42 | ||
33 | # The sstate manifests | 43 | # The sstate manifests |
34 | rm -rf $BUILDDIR/tmp/sstate-control/manifest-*.populate-sysroot | 44 | rm -rf "$SSTATE_MANIFESTS/manifest-*.populate-sysroot" |