Krzysztof Pawlik schrieb:
> On 30/04/12 10:39, Ulrich Mueller wrote:
>>>>>>> On Mon, 30 Apr 2012, Krzysztof Pawlik wrote:
>>
>>> On 30/04/12 10:12, Ulrich Mueller wrote:
>>>> If the eclass doesn't work with FEATURES="collision-protect" then it
>>>> needs to be fixed.
>>
>>> Long story short: older eclass compiled Python byte code in live
>>> file system, new one does it in src_install so .pyo/.pyc gets
>>> properly recorded,
>>
>> That's a good change.
>
>

>
>>> so the package *has to overwrite* files that are not owned by anyone
>>> (no package owns them).
>>
>> The usual approach to this problem was to have some cleanup code in
>> pkg_setup or pkg_preinst that would remove the old files.
>
> Interesting idea - I see two problems:
> - how I would get the list of files for already installed version (the file
> list can (and will) differ between versions)
Simple workaround in pkg_preinst (just example code, nothing to copy/paste):
if has_version < first_good_version ; then
for i in $(find ${D} -name *.{pyc,pyo}) ; do
[[ -e ${i/${D}/${ROOT}/} ]] && rm ${i/${D}/${ROOT}/}
done
fi
Alternatively, you could take all .py files of the installed versions
and blindly remove the pyo/pyc files for them in pkg_preinst (this
should also prevent leaving dead files around).
--
Thomas Sachau
Gentoo Linux Developer