Patchwork scripts/wipe-sysroot: add script to safely wipe the sysroots

login
register
mail settings
Submitter Ross Burton
Date Jan. 25, 2013, 5:43 p.m.
Message ID <1359135782-8953-1-git-send-email-ross.burton@intel.com>
Download mbox | patch
Permalink /patch/43399/
State Accepted
Commit ef98ff5ba562eb710b5a6fbd181fb1c4380010b2
Headers show

Comments

Ross Burton - Jan. 25, 2013, 5:43 p.m.
Add a script to wipe the sysroots and all of the relevant stamps, so that it
will be correctly re-populated.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 scripts/wipe-sysroot |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100755 scripts/wipe-sysroot
Paul Eggleton - Jan. 25, 2013, 6:16 p.m.
On Friday 25 January 2013 17:43:02 Ross Burton wrote:
> Add a script to wipe the sysroots and all of the relevant stamps, so that it
> will be correctly re-populated.

What I'm missing from this and/or the script header is when you would need to 
do this... ?

Cheers,
Paul
Ross Burton - Jan. 25, 2013, 7:40 p.m.
On 25 January 2013 18:16, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> On Friday 25 January 2013 17:43:02 Ross Burton wrote:
>> Add a script to wipe the sysroots and all of the relevant stamps, so that it
>> will be correctly re-populated.
>
> What I'm missing from this and/or the script header is when you would need to
> do this... ?

I primarily use it to verify that build dependencies are correct (wipe
sysroot, build package), but it's also useful if you end up trashing
your sysroots as it's vastly faster than wiping your entire TMPDIR.

Ross

Patch

diff --git a/scripts/wipe-sysroot b/scripts/wipe-sysroot
new file mode 100755
index 0000000..e751a91
--- /dev/null
+++ b/scripts/wipe-sysroot
@@ -0,0 +1,34 @@ 
+#! /bin/sh
+
+# Wipe out all of the sysroots and all of the stamps that populated it.
+# Author: Ross Burton <ross.burton@intel.com>
+#
+# Copyright (c) 2012 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [ -z "$BUILDDIR" ]; then
+    echo >&2 "Error: BUILDDIR is not defined, please initialise the build system."
+    return 1
+fi
+
+# The sysroots themselves
+rm -rf $BUILDDIR/tmp/sysroots/
+
+# The stamps that said the sysroot was populated
+rm -rf $BUILDDIR/tmp/stamps/*/*/*.do_populate_sysroot.*
+rm -rf $BUILDDIR/tmp/stamps/*/*/*.do_populate_sysroot_setscene.*
+
+# The sstate manifests
+rm -rf $BUILDDIR/tmp/sstate-control/manifest-*.populate-sysroot