[OE-core] [PATCH] wipe-sysroot: explain what is being deleted and require confirmation

Ross Burton ross.burton at intel.com
Fri Nov 1 19:47:13 UTC 2013


Instead of rushing into deleting entire directory trees without any warning,
print the directories and files that will be deleted and require confirmation
from the user (via --force) that they want files to be deleted.

[ YOCTO #5423 ]

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/wipe-sysroot |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/scripts/wipe-sysroot b/scripts/wipe-sysroot
index 7ca26fe..306c877 100755
--- a/scripts/wipe-sysroot
+++ b/scripts/wipe-sysroot
@@ -33,14 +33,23 @@ if [ -z "$SSTATE_MANIFESTS" -o -z "$STAGING_DIR" -o -z "$STAMPS_DIR" ]; then
     exit 1
 fi
 
-# The sysroots themselves
-rm -rf $STAGING_DIR
+echo "Will delete $STAGING_DIR."
+echo "Will also delete selected stamps from $SSTATE_MANIFESTS and $STAMPS_DIR."
 
-# The stamps that said the sysroot was populated
-rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
-rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*
-rm -rf $STAMPS_DIR/*/*/*.do_packagedata.*
-rm -rf $STAMPS_DIR/*/*/*.do_packagedata_setscene.*
+if [ "$1" = "--force" ]; then
+    echo "Deleting..."
 
-# The sstate manifests
-rm -rf $SSTATE_MANIFESTS/manifest-*.populate-sysroot
+    # The sysroots themselves
+    rm -rf $STAGING_DIR
+
+    # The stamps that said the sysroot was populated
+    rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
+    rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*
+    rm -rf $STAMPS_DIR/*/*/*.do_packagedata.*
+    rm -rf $STAMPS_DIR/*/*/*.do_packagedata_setscene.*
+
+    # The sstate manifests
+    rm -rf $SSTATE_MANIFESTS/manifest-*.populate-sysroot
+else
+    echo "\nThis was a dry-run.  Run with --force to delete the files."
+fi
-- 
1.7.10.4




More information about the Openembedded-core mailing list