Patchwork [2/3] sstate-cache-management.sh: don't hardcode available sstate_suffixes

login
register
mail settings
Submitter Hongxu Jia
Date Feb. 26, 2013, 7:57 a.m.
Message ID <6f7e1c603262f5e0d82d05981d131d189da4fa6b.1361864565.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/45075/
State Accepted
Commit 26adfcb8c33fe62f5e15c3591efc670d70cbb5b7
Headers show

Comments

Hongxu Jia - Feb. 26, 2013, 7:57 a.m.
Don't hardcode available sstate_suffixes(it misses `packagedata'), find them
dynamically in $sstate_list.

[YOCTO #3635]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 scripts/sstate-cache-management.sh |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Patch

diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh
index 2d4a2a3..90e6764 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -185,11 +185,16 @@  remove_duplicated () {
           | sed -e 's/-/_/g' -e 's/ /\n/g' | sort -u)
   echo "Done"
 
-  sstate_suffixes="deploy-rpm deploy-ipk deploy-deb deploy package populate-lic populate-sysroot"
-
   # Save all the sstate files in a file
   sstate_list=`mktemp` || exit 1
   find $cache_dir -name 'sstate-*.tgz' >$sstate_list
+
+  echo -n "Figuring out the suffixes in the sstate cache dir ... "
+  sstate_suffixes="`sed 's/.*_\([^_]*\)\.tgz$/\1/g' $sstate_list | sort -u`"
+  echo "Done"
+  echo "The following suffixes have been found in the cache dir:"
+  echo $sstate_suffixes
+
   echo -n "Figuring out the archs in the sstate cache dir ... "
   for arch in $all_archs; do
       grep -q "\-$arch-" $sstate_list