[oe] script to remove orphaned files

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Mon Sep 13 21:15:52 UTC 2010


2010/9/13 Khem Raj <raj.khem at gmail.com>:
> On Mon, Sep 13, 2010 at 1:20 PM, Frans Meulenbroeks
> <fransmeulenbroeks at gmail.com> wrote:
>> As I don't really see progress on this, I am planning to take action
>> in a few days.
>> Since Khem expressed a preference to keep the files accessible, I'm
>> planning not to remove the unneeded patches, but instead move the to
>> the obsolete dir.
>> (alternate could be to move them to a dir called unused in the recipe dir).
>> Removal will be tested by verifying that bitbake -c patch remains
>> working on all dirs where unused files are removed.
>>
>
> sometimes same names patches exist in different dirs and if you remove
> one then it will start picking the other one
> silently so make sure such cases are not there. In general I am wary
> of mass changes which could creep in some bugs like that
> Ideally I would suggest that you look at each and every change before its final.
>

I am aware of thi (and the trickery behind FILESDIR and FILESPATHPKG
(if I remembered the names right).
The starting point of this is the patch file.
If the file occurs in any recipe (*.bb or *.inc file) in that dir the
file will not be moved.

The script goes like:
find -name "*.diff" -o -name "*.patch" | (while  read name
   do
       bname=`basename $name`
       grep -q $bname *.bb *.inc || \
       if [ $delete -eq 0 ]
       then
       echo $name " is unused"
       else
# cmd to create dir before the move has to be added here
       git mv $name unused/$name
       removed=1
       fi
   done

Also recipes which have a file:// construct with ${PV} in it will be
untouched (or manually processed).
I can make and post patches for this but the amount will probably not
make anyone happy. (don't have the exact number of files handy, it is
listed before in an earlier thread, but I vaguley recall some 200+
files, not sure about the # of recipes affected.

Frans




More information about the Openembedded-devel mailing list