A script to clean obsolete sstate cache files
cover A script to clean obsolete sstate cache files
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed
// Robert
The following changes since commit 87e32edb88c30ac116fa396148ac26357051f93a:
iputils: Add base_libdir to VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib robert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstate
Robert Yang (1):
A script to clean obsolete sstate cache files
scripts/sstate-cache-management.sh | 135 ++++++++++++++++++++++++++++++++++++ 1 files changed, 135 insertions(+), 0 deletions(-) create mode 100755 scripts/sstate-cache-management.sh
Signature · 1 line
1.7.4.1
Op 22 feb. 2012, om 14:27 heeft Robert Yang het volgende geschreven:
Quoted 17 lines
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
Quoted 7 lines
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstate
Do you have a patch against oe-core instead of poky??!?
Quoted 21 lines · Koen Kooi
Op 22 feb. 2012, om 14:27 heeft Robert Yang het volgende geschreven:
Quoted 19 lines
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:
Quoted 7 lines
Quoted 5 lines
iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstateDo you have a patch against oe-core instead of poky??!?
Does this really need as many question and exclamation marks???!!!!????!
;-)
Its not hard to manipulate the patches around from one tree to the other.
Cheers,
Richard
Op 22 feb. 2012, om 15:15 heeft Richard Purdie het volgende geschreven:
Quoted 28 lines · Koen Kooi
Quoted 27 lines
Op 22 feb. 2012, om 14:27 heeft Robert Yang het volgende geschreven:
Quoted 24 lines
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstate
Quoted 8 lines
Quoted 1 line
Do you have a patch against oe-core instead of poky??!?
Does this really need as many question and exclamation marks???!!!!????!
;-)
Its not hard to manipulate the patches around from one tree to the other.
That's good to know, so why wasn't it manipulated to work on oe-core when being sent to the oe-core list?
Quoted 32 lines · Koen Kooi
Op 22 feb. 2012, om 15:15 heeft Richard Purdie het volgende geschreven:
Quoted 30 lines · Koen Kooi
Quoted 28 lines
Op 22 feb. 2012, om 14:27 heeft Robert Yang het volgende geschreven:
Quoted 17 lines
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
Quoted 7 lines
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstateDo you have a patch against oe-core instead of poky??!?
Quoted 8 lines
Quoted 6 lines
Does this really need as many question and exclamation marks???!!!!????!
;-)
Its not hard to manipulate the patches around from one tree to the other.
That's good to know, so why wasn't it manipulated to work on oe-core when being sent to the oe-core list?
Or why can't people just cherry-pick the patch in, or apply the patch manually? The latter is no different to people who just supply the patches manually the the list with no corresponding git tree after all.
Cheers,
Richard
Op 22 feb. 2012, om 16:06 heeft Richard Purdie het volgende geschreven:
Quoted 37 lines · Koen Kooi
Quoted 36 lines
Op 22 feb. 2012, om 15:15 heeft Richard Purdie het volgende geschreven:
Quoted 34 lines · Koen Kooi
Quoted 21 lines
Op 22 feb. 2012, om 14:27 heeft Robert Yang het volgende geschreven:
Quoted 19 lines
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:Quoted 7 lines
Quoted 5 lines
iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstateDo you have a patch against oe-core instead of poky??!?
Does this really need as many question and exclamation marks???!!!!????!
;-)
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Its not hard to manipulate the patches around from one tree to the other.
That's good to know, so why wasn't it manipulated to work on oe-core when being sent to the oe-core list?
Or why can't people just cherry-pick the patch in, or apply the patch manually?
Personally, I'm too lazy for that. If someone sends a pull request to oe-core I kinda assume it's for oe-core. I tried to pull it in for testing and it blew up.
Quoted 42 lines · Koen Kooi
Op 22 feb. 2012, om 16:06 heeft Richard Purdie het volgende geschreven:
Quoted 40 lines · Koen Kooi
Quoted 39 lines
Op 22 feb. 2012, om 15:15 heeft Richard Purdie het volgende geschreven:
Quoted 36 lines · Koen Kooi
Quoted 21 lines
Op 22 feb. 2012, om 14:27 heeft Robert Yang het volgende geschreven:
Quoted 19 lines
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:Quoted 7 lines
Quoted 5 lines
iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstateDo you have a patch against oe-core instead of poky??!?
Does this really need as many question and exclamation marks???!!!!????!
;-)
Its not hard to manipulate the patches around from one tree to the other.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
That's good to know, so why wasn't it manipulated to work on oe-core when being sent to the oe-core list?
Or why can't people just cherry-pick the patch in, or apply the patch manually?
Personally, I'm too lazy for that. If someone sends a pull request to oe-core I kinda assume it's for oe-core. I tried to pull it in for testing and it blew up.
So I think its reasonable for people to indicate which tree the pull request is based off and I'll suggest people do this in future.
If its not indicated, oe-core is a reasonable assumption but providing a poky tree for convenience shouldn't cause quite as much friction as it does since it is better than no tree at all and some of us can manage them fine.
Cheers,
Richard
Quoted 4 lines · Richard Purdie
If its not indicated, oe-core is a reasonable assumption but providing a poky tree for convenience shouldn't cause quite as much friction as it does since it is better than no tree at all and some of us can manage them fine.
I fully disagree.
This is an OE-Core mailing list so it is expected to have patches here based on OE-Core mailing list.
Mistakes are also expected to happen, as just did, and it is just a matter of resending it to fix it. Relaxing it will make the whole testing cycle a nightmare for all people involved in OE-Core.
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Quoted 3 lines · Richard Purdie
Or why can't people just cherry-pick the patch in, or apply the patch manually? The latter is no different to people who just supply the patches manually the the list with no corresponding git tree after all.
Because this mean to have and maintain a full clone of the repository and I don't want and I won't do that.
OE-Core is the base, the mailing list is based on it so it is expected of it being based on OE-Core.
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Quoted 9 lines · On Wednesday 22 February 2012 13:47:45 Otavio Salvador wrote:
On Wed, Feb 22, 2012 at 13:06, Richard Purdie
Quoted 3 lines · <[email protected]> wrote:
Or why can't people just cherry-pick the patch in, or apply the patch manually? The latter is no different to people who just supply the patches manually the the list with no corresponding git tree after all.
Because this mean to have and maintain a full clone of the repository and I don't want and I won't do that.
Except here we are talking about a single patch that adds a single file, which is easily downloadable from the web interface. If it were more complicated I could understand the fuss, but right now this is almost ridiculous.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Quoted 3 lines · Paul Eggleton
Except here we are talking about a single patch that adds a single file, which is easily downloadable from the web interface. If it were more complicated I could understand the fuss, but right now this is almost ridiculous.
It doesn't seem that easy; it seems Koen tried to apply it and it has failed.
Besides, Robert didn't complain about people asking it to be resend. Who is complaining is Richard and I am just justifying the reasoning why it is more the logical to expect it to be done based on OE-Core.
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Quoted 11 lines · Otavio Salvador
Quoted 3 lines · Paul Eggleton
Except here we are talking about a single patch that adds a single file, which is easily downloadable from the web interface. If it were more complicated I could understand the fuss, but right now this is almost ridiculous.
It doesn't seem that easy; it seems Koen tried to apply it and it has failed.
Besides, Robert didn't complain about people asking it to be resend. Who is complaining is Richard and I am just justifying the reasoning why it is more the logical to expect it to be done based on OE-Core.
In this case, Richard is presenting the viewpoint he's heard expressed by a number of people in private but who don't want to rock the boat on the mailing list. I'd like to see the mailing list be a friendly place where people don't get flamed for posting patches. Some of the recent responses are less than friendly and I think its reasonable to try and resolve this.
I'm going to propose that if trees are poky based, the pull request should indicate this. People can then act accordingly. No indication means its oe-core derived.
Cheers,
Richard
Quoted 20 lines · Richard Purdie
Quoted 11 lines · Otavio Salvador
Quoted 3 lines · Paul Eggleton
Except here we are talking about a single patch that adds a single file, which is easily downloadable from the web interface. If it were more complicated I could understand the fuss, but right now this is almost ridiculous.
It doesn't seem that easy; it seems Koen tried to apply it and it has failed.
Besides, Robert didn't complain about people asking it to be resend. Who is complaining is Richard and I am just justifying the reasoning why it is more the logical to expect it to be done based on OE-Core.
In this case, Richard is presenting the viewpoint he's heard expressed by a number of people in private but who don't want to rock the boat on the mailing list. I'd like to see the mailing list be a friendly place where people don't get flamed for posting patches. Some of the recent responses are less than friendly and I think its reasonable to try and resolve this.
Quoted 3 lines
I'm going to propose that if trees are poky based, the pull request should indicate this. People can then act accordingly. No indication means its oe-core derived.
If you look at *my* first reply to this thread I just asked him to resend it based on OE-Core - as he already did - so I could give it a test. This seemed quite friendly from my POV and he didn't complain.
If people dislike it, it is better if they show up and don't hide behind you.
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Quoted 3 lines · Otavio Salvador
If you look at *my* first reply to this thread I just asked him to resend it based on OE-Core - as he already did - so I could give it a test. This seemed quite friendly from my POV and he didn't complain.
You'll also notice I directed my comments to Koen's reply, not yours.
Since we're on the subject though, I do believe there is marginal value in asking someone to rebase a single patch you could have just as easily downloaded and applied yourself. I am respectful and protective of people's time and in this case I think there are better ways things could have been handled.
Overall though my main objective was to avoid these "Please rebase on OE-Core????!!!!?" type messages and I think we've figured out a way to do that.
Quoted 1 line
If people dislike it, it is better if they show up and don't hide behind you.
We have many different people involved with the project with different personalities and cultural backgrounds. Open source projects should be as open, inclusive and friendly as possible in my view. We do have some participants who get put off by the form of some of the replies on list and would prefer not to get involved in what could potentially become "flame war" type discussions. I'd even personally like to avoid them to as they kill my productivity but sadly my role means I cannot.
I am happy to listen to people's concerns and do what I can to improve things where I see opportunities. I only received comments from one other person about this specific thread and they have responded on list. I have received many different comments on the general topic from previous similar threads though so I do have an idea of some people's feelings on this topic. I happen to have chosen this moment in time to try and resolve the issue. I don't see an problem in any of these things.
Cheers,
Richard
Quoted 8 lines · Otavio Salvador
Quoted 3 lines · Richard Purdie
Or why can't people just cherry-pick the patch in, or apply the patch manually? The latter is no different to people who just supply the patches manually the the list with no corresponding git tree after all.
Because this mean to have and maintain a full clone of the repository and I don't want and I won't do that.
Applying the patch manually (either with "git am" or directly with "patch") doesn't require you to have a copy of poky on hand. That doesn't seem like such a hardship, particularly given that the patch in question here is just creating a single new file and doesn't touch any existing content at all.
p.
Quoted 5 lines · Robert Yang
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc
Quoted 9 lines
Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed
That's awesome. I was looking for a script for this.
Can you please resend it based on oe-core? I'll give it a good test.
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH 1/1 A script to clean obsolete sstate cache files
In reply to Robert YangThere would be many obsolete cache files in the SSTATE_DIR after several builds, this script can remove the obsolete one for a pkg, only leave the up to date one.
Here is the help text:
sstate-cache-management.sh <OPTION>
Options:
--help, -h
Display this help and exit.
--cache-dir=<sstate cache dir>
Specify sstate cache directory, will use the environment variable SSTATE_CACHE_DIR if it is not specified.
--remove-duplicated
Remove the duplicated sstate cache files of one package, only the newest one would be kept.
[YOCTO #1682]
--- scripts/sstate-cache-management.sh | 135 ++++++++++++++++++++++++++++++++++++ 1 files changed, 135 insertions(+), 0 deletions(-) create mode 100755 scripts/sstate-cache-management.sh
scripts/sstate-cache-management.sh new file +135 -0
@@ -0,0 +1,135 @@ +#!/bin/bash + +# Copyright (c) 2012 Wind River Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +usage () { + cat << EOF +Welcome to sstate cache management utilities. +sstate-cache-management.sh <OPTION> + +Options: + --help, -h + Display this help and exit. + + --cache-dir=<sstate cache dir> + Specify sstate cache directory, will use the environment + variable SSTATE_CACHE_DIR if it is not specified. + + --remove-duplicated + Remove the duplicated sstate cache files of one package, only + the newest one would be kept. + +EOF +} + +if [ $# -lt 1 ]; then + usage + exit 0 +fi + +# Print error information and exit. +echo_error () { + echo "ERROR: $1" >&2 + exit 1 +} + +# Remove the duplicated cache files for the pkg, keep the newest one +remove_duplicated () { + local all_suffixes="$1" + local ava_archs="$2" + local total_deleted=0 + for suffix in $all_suffixes; do + local deleted=0 + echo -n "Removing the sstate-xxx_$suffix.tgz ... " + # sed twice to avoid the greedy match + file_names=`for arch in $ava_archs; do + ls sstate-*-$arch-*_$suffix.tgz 2>/dev/null | \ + sed -e 's/\(.*\)-'"$arch"'-.*/\1/' \ + -e 's/\(.*\)-'"$arch"'-.*/\1/' + done | sort -u` + + for fn in $file_names; do + for arch in $ava_archs; do + ls $fn-$arch-*_$suffix.tgz 2>/dev/null >>/tmp/$fn + done + # Also delete the .siginfo file + to_del=$(ls -t $(cat /tmp/$fn) | sed -n '1!p' | sed -e 'p' -e 's/$/.siginfo/') + rm -f $to_del + let deleted=$deleted+`echo $to_del | wc -w` + rm -f /tmp/$fn + done + echo "($deleted files)" + let total_deleted=$total_deleted+$deleted + done + echo "$total_deleted files have been removed" +} + +# Parse arguments +while [ -n "$1" ]; do + case $1 in + --cache-dir=*) + cache_dir=`echo $1 | sed -e 's#^--cache-dir=##' -e 's#/*$##' | xargs readlink -f` + [ -d "$cache_dir" ] || echo_error "Invalid argument to --cache-dir" + shift + ;; + --remove-duplicated) + rm_duplicated="yes" + shift + ;; + --help|-h) + usage + exit 0 + ;; + *) + echo "Invalid arguments $*" + echo_error "Try 'sstate-cache-management.sh -h' for more information." + ;; + esac +done + +# sstate cache directory, use environment variable SSTATE_CACHE_DIR +# if it was not specified, otherwise, error. +[ -n "$cache_dir" ] || cache_dir=$SSTATE_CACHE_DIR +[ -d "$cache_dir" ] || echo_error "Invalid cache directory \"$cache_dir\"" + +cache_dir=`readlink -f $cache_dir` + +topdir=$(dirname $(dirname $(readlink -f $0))) +tunedir=$topdir/meta/conf/machine/include +[ -d $tunedir ] || echo_error "Can't find the tune directory" + +# Use the "_" to substitute "-", e.g., x86-64 to x86_64 +all_archs=`grep -r DEFAULTTUNE $tunedir | \ + sed -e 's/.*\"\(.*\)\"/\1/' -e 's/-/_/g' | sort -u` +# Add the qemu archs +all_archs="$all_archs qemuarm qemux86 qemumips qemuppc" + +all_suffixes="deploy-rpm deploy-ipk deploy-deb deploy package populate-lic populate-sysroot" + +cd $cache_dir + +echo "Figuring out the archs in the sstate cache dir ..." +for arch in $all_archs; do + ls | grep -q -w $arch + [ $? -eq 0 ] && ava_archs="$ava_archs $arch" +done +echo "The following archs have been found in the sstate cache dir:" +echo $ava_archs + +if [ "$rm_duplicated" == "yes" -a -n "$ava_archs" ]; then + remove_duplicated "$all_suffixes" "$ava_archs" +fi
Signature · 1 line
1.7.4.1
Saul Wold
AppliedQuoted 25 lines · Robert Yang
Here is the testing result:
$ ./poky/scripts/sstate-cache-management.sh --cache-dir=sstate-cache.bak/ --remove-duplicated Figuring out the archs in the sstate cache dir ... The following archs have been found in the sstate cache dir: i586 ppc603e x86_64 qemux86 qemuppc Removing the sstate-xxx_deploy-rpm.tgz ... (3034 files) Removing the sstate-xxx_deploy-ipk.tgz ... (0 files) Removing the sstate-xxx_deploy-deb.tgz ... (0 files) Removing the sstate-xxx_deploy.tgz ... (8 files) Removing the sstate-xxx_package.tgz ... (3282 files) Removing the sstate-xxx_populate-lic.tgz ... (2482 files) Removing the sstate-xxx_populate-sysroot.tgz ... (3282 files) 12088 files have been removed// Robert
The following changes since commit
87e32edb88c30ac116fa396148ac26357051f93a:iputils: Add
base_libdirto VPATH in order to find the crypto library (2012-02-21 17:59:40 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/remove-sstate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/remove-sstate
Quoted 7 lines
Robert Yang (1):
A script to clean obsolete sstate cache filesscripts/sstate-cache-management.sh | 135 ++++++++++++++++++++++++++++++++++++ 1 files changed, 135 insertions(+), 0 deletions(-)create mode 100755
scripts/sstate-cache-management.sh
Merged into OE-core
Thanks
Sau!