From 769a000428e4b2462a4e6d8f179b5816b8ec2417 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Fri, 30 Mar 2012 14:44:31 +0800 Subject: sstate-cache-management.sh: fixes and enhancement Fix a few problems and enhance its functions, it shoud be more useful than before. * Search in meta and meta-* for archs, and grep AVAILTUNES for archs, (only search meta, and grep DEFAULTTUNE before), add the host arch. and also can search in extra layers with --extra-layer. * Reduce the analyzing time when remove duplicated files. It would cost more than 10 minutes to analyze 11,000 files before, now only needs about 50 seconds. * Check the access time rather than create time. * Need the user's confirm before really remove the file, or use --yes to assume yes. * Add --stamps-dir to keep sstate files which are used by the build directory, and remove others this can make the sstate cache dir clean, it is faster and should be useful than the --remove-duplicated. * Add --verbose to explain what is being done. * Add "-d" which is short for --remove-duplicated [YOCTO #2198] Signed-off-by: Robert Yang Signed-off-by: Richard Purdie --- scripts/sstate-cache-management.sh | 289 ++++++++++++++++++++++++++++++------- 1 file changed, 240 insertions(+), 49 deletions(-) (limited to 'scripts') diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh index d0e3abc82..be185bbb4 100755 --- a/scripts/sstate-cache-management.sh +++ b/scripts/sstate-cache-management.sh @@ -16,22 +16,54 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# Global vars +cache_dir= +confirm= +total_deleted=0 +verbose= + usage () { cat << EOF Welcome to sstate cache management utilities. sstate-cache-management.sh