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>
This commit is contained in:
Martin Jansa 2012-09-03 17:05:08 +02:00 committed by Richard Purdie
parent 40b14022db
commit 0740f82aea
1 changed files with 27 additions and 25 deletions

View File

@ -217,9 +217,9 @@ remove_duplicated () {
for fn in $file_names; do
[ -z "$verbose" ] || echo "Analyzing $fn-xxx_$suffix.tgz"
for arch in $ava_archs; do
grep -h "/$fn-$arch-" $list_suffix >>$fn_tmp
done
[ $debug -gt 1 ] && echo "Available files for $fn with suffix $suffix:" && cat $fn_tmp
grep -h "/$fn-$arch-" $list_suffix >$fn_tmp
if [ -s $fn_tmp ] ; then
[ $debug -gt 1 ] && echo "Available files for $fn-$arch- with suffix $suffix:" && cat $fn_tmp
# Use the modification time
to_del=$(ls -t $(cat $fn_tmp) | sed -n '1!p')
[ $debug -gt 2 ] && echo "Considering to delete: $to_del"
@ -244,6 +244,8 @@ remove_duplicated () {
rm -f $fn_tmp
[ $debug -gt 2 ] && echo "Decided to delete: $to_del"
gen_rmlist $rm_list "$to_del"
fi
done
done
[ ! -s "$rm_list" ] || deleted=`cat $rm_list | wc -l`
[ -s "$rm_list" -a $debug -gt 0 ] && cat $rm_list