[oe] script to remove orphaned files

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Thu Sep 16 20:56:55 UTC 2010


2010/9/13 Philip Balister <philip at balister.org>:
> On 09/13/2010 04:42 PM, Khem Raj wrote:
>>
>> 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 agree with Khem. please do this a directory of recipes at a time.
>
> Philip
>
Dear all,

I've just pushed the first few recipes. One at a time would stretch it
very long (there are some 160 recipe dirs with unused files), so was
planning to take the recipes starting with the same letter at the same
time (or if there only one or two recipes in it I might combine a
little bit, e.g. as a starter I've taken the recipes starting with z
(1 recipe folder with dups) and a (5 recipe folders with dups).
For letters that have many recipes with dups I'll probably split in two.
Btw I am not going to do this in strict alphabetical order. b and g
(which contain quite some dups for binutils and gcc) will probably be
done last.

And if a recipe maintainer wants to do the work him/herself: greatly
appreciated. Just go ahead.
I've pushed the script I use to do this. It is in contrib and called
clean-recipe.

The patches I just pushed are tested using bitbake -c patch for all
recipes as far as possible).
(in the recipes I pushed I could not test alsa-scenario_git.bb as it
didn't fetch for me and alsa-driver_0.9.6-hh4c.bb as it was for h3600
and h3900 only),
Results are both visually reviewed as well as a grep on failed. The
two failing recipes got an additional verification by checking that
the patches for it were not deleted.

Enjoy! Frans.

PS: wrt the remark of Khem: if a patch file is used in any recipe the
file is never removed. I'm staying at the safe side here (and the
downside is that there might still be a few unused files left, but at
least the bulk of the work is done, doing a full-fledged cleanup would
require parsing the bb files fully and emitting a list of all patches
that are applied (including directory), then remove the files in the
list. That can also deal with things like ${PV} in a patch. Probably
it is not overly complicated to write something like this, but it is
beyond my current capabilities, guess it would require instrumenting
do_patch to echo the name, then do a -c patchall or so). Anyway, no
plans to do that for now. FM.




More information about the Openembedded-devel mailing list