summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2012-09-03 17:05:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-04 12:53:10 +0100
commit0740f82aea92da0195524e37c372f9981e7f5e6d (patch)
tree7296c2abbd950de47b57cd5a8f1b5333634ddd54 /scripts
parent40b14022db6012ea911566a679c178ffd619259f (diff)
downloadpoky-0740f82aea92da0195524e37c372f9981e7f5e6d.tar.gz
sstate-cache-management.sh: fix remove_duplicated when multiple archs were built
* The problem is that you're looking for duplicates across all available archs, so armv4t and armv7a populate_sysroot are considered duplicate and only last one is kept, but to rebuild from sstate-cache you need both! (From OE-Core rev: 46309e96300c35f6e8a5f33512a6a38720c629d2) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/sstate-cache-management.sh52
1 files changed, 27 insertions, 25 deletions
diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh
index 0cfff77b18..f519555d59 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -217,33 +217,35 @@ remove_duplicated () {
217 for fn in $file_names; do 217 for fn in $file_names; do
218 [ -z "$verbose" ] || echo "Analyzing $fn-xxx_$suffix.tgz" 218 [ -z "$verbose" ] || echo "Analyzing $fn-xxx_$suffix.tgz"
219 for arch in $ava_archs; do 219 for arch in $ava_archs; do
220 grep -h "/$fn-$arch-" $list_suffix >>$fn_tmp 220 grep -h "/$fn-$arch-" $list_suffix >$fn_tmp
221 done 221 if [ -s $fn_tmp ] ; then
222 [ $debug -gt 1 ] && echo "Available files for $fn with suffix $suffix:" && cat $fn_tmp 222 [ $debug -gt 1 ] && echo "Available files for $fn-$arch- with suffix $suffix:" && cat $fn_tmp
223 # Use the modification time 223 # Use the modification time
224 to_del=$(ls -t $(cat $fn_tmp) | sed -n '1!p') 224 to_del=$(ls -t $(cat $fn_tmp) | sed -n '1!p')
225 [ $debug -gt 2 ] && echo "Considering to delete: $to_del" 225 [ $debug -gt 2 ] && echo "Considering to delete: $to_del"
226 # The sstate file which is downloaded from the SSTATE_MIRROR is 226 # The sstate file which is downloaded from the SSTATE_MIRROR is
227 # put in SSTATE_DIR, and there is a symlink in SSTATE_DIR/??/ to 227 # put in SSTATE_DIR, and there is a symlink in SSTATE_DIR/??/ to
228 # it, so filter it out from the remove list if it should not be 228 # it, so filter it out from the remove list if it should not be
229 # removed. 229 # removed.
230 to_keep=$(ls -t $(cat $fn_tmp) | sed -n '1p') 230 to_keep=$(ls -t $(cat $fn_tmp) | sed -n '1p')
231 [ $debug -gt 2 ] && echo "Considering to keep: $to_keep" 231 [ $debug -gt 2 ] && echo "Considering to keep: $to_keep"
232 for k in $to_keep; do 232 for k in $to_keep; do
233 if [ -L "$k" ]; then 233 if [ -L "$k" ]; then
234 # The symlink's destination 234 # The symlink's destination
235 k_dest="`readlink -e $k`" 235 k_dest="`readlink -e $k`"
236 # Maybe it is the one in cache_dir 236 # Maybe it is the one in cache_dir
237 k_maybe="$cache_dir/${k##/*/}" 237 k_maybe="$cache_dir/${k##/*/}"
238 # Remove it from the remove list if they are the same. 238 # Remove it from the remove list if they are the same.
239 if [ "$k_dest" = "$k_maybe" ]; then 239 if [ "$k_dest" = "$k_maybe" ]; then
240 to_del="`echo $to_del | sed 's#'\"$k_maybe\"'##g'`" 240 to_del="`echo $to_del | sed 's#'\"$k_maybe\"'##g'`"
241 fi 241 fi
242 fi
243 done
244 rm -f $fn_tmp
245 [ $debug -gt 2 ] && echo "Decided to delete: $to_del"
246 gen_rmlist $rm_list "$to_del"
242 fi 247 fi
243 done 248 done
244 rm -f $fn_tmp
245 [ $debug -gt 2 ] && echo "Decided to delete: $to_del"
246 gen_rmlist $rm_list "$to_del"
247 done 249 done
248 [ ! -s "$rm_list" ] || deleted=`cat $rm_list | wc -l` 250 [ ! -s "$rm_list" ] || deleted=`cat $rm_list | wc -l`
249 [ -s "$rm_list" -a $debug -gt 0 ] && cat $rm_list 251 [ -s "$rm_list" -a $debug -gt 0 ] && cat $rm_list