blob: 5e6b1a4e2a5bab324cc415a0e09abe5d5df856cf [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#! /bin/sh
2
3# Wipe out all of the sysroots and all of the stamps that populated it.
4# Author: Ross Burton <ross.burton@intel.com>
5#
6# Copyright (c) 2012 Intel Corporation
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 2 as
10# published by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15# See the GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
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
20
21set -e
22
23if [ $# -gt 0 ]; then
24 echo "Wipe all sysroots and sysroot-related stamps for the current build directory." >&2
25 echo "Usage: $0" >&2
26 exit 1
27fi
28
29ENVS=`mktemp --suffix -wipe-sysroot-envs`
30bitbake -p -e > $ENVS
31
32eval `grep -F SSTATE_MANIFESTS= $ENVS`
33eval `grep -F STAGING_DIR= $ENVS`
34eval `grep -F STAMPS_DIR= $ENVS`
35rm -f $ENVS
36
37if [ -z "$SSTATE_MANIFESTS" -o -z "$STAGING_DIR" -o -z "$STAMPS_DIR" ]; then
38 echo "Could not determine SSTATE_MANIFESTS/STAGING_DIR/STAMPS_DIR from bitbake, check above for errors"
39 exit 1
40fi
41
42echo "Deleting the sysroots in $STAGING_DIR, and selected stamps in $SSTATE_MANIFESTS and $STAMPS_DIR."
43
44# The sysroots themselves
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050045rm -rf $STAGING_DIR ${STAGING_DIR}-uninative
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046
47# The stamps that said the sysroot was populated
48rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
49rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*
50rm -rf $STAMPS_DIR/*/*/*.do_packagedata.*
51rm -rf $STAMPS_DIR/*/*/*.do_packagedata_setscene.*
52
53# The sstate manifests
Patrick Williamsc0f7c042017-02-23 20:41:17 -060054rm -rf $SSTATE_MANIFESTS/manifest-*.populate_sysroot