On 30/04/12 11:28, Michał Górny wrote:
> On Mon, 30 Apr 2012 10:23:03 +0200
> Krzysztof Pawlik <nelch...@gentoo.org> wrote:
> 
>> On 30/04/12 10:12, Ulrich Mueller wrote:
>>>>>>>> On Mon, 30 Apr 2012, Michał Górny wrote:
>>>> Since lately Gentoo devs force you to replace collision-protect
>>>> with protect-owned [1] and sometimes packages just spit out files
>>>> randomly on the filesystem due to random errors, I thought it may
>>>> be a good idea to provide a new feature limiting the locations
>>>> where packages can install.
>>>
>>> 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, so the package *has to overwrite* files that are not owned
>> by anyone (no package owns them). I've talked to Zac and:
>>
>>>>>
>> There's not much else you can do. However, FEATURES="protect-owned" is
>> enabled by default, and it will work fine if the .pyo and .pyc files
>> are not owned by anything. I don't know why people use
>> FEATURES="collision-protect", but at least you can tell them that
>> they'll still have a reasonable level of protection from
>> FEATURES="protect-owned" (it protect against file collisions between
>> packages).
>> <<<
>>
>> If you want to help feel free to suggest *how* to fix it, patches are
>> especially welcomed :)
> 
> Just make it warn or something like that. Or even fail but only when
> such files exist. There is no point in forcing me to disable
> collision-protect when the ebuilds were migrated already.

Does this work for you:

$ cvs diff python-distutils-ng.eclass
Index: python-distutils-ng.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v
retrieving revision 1.12
diff -u -r1.12 python-distutils-ng.eclass
--- python-distutils-ng.eclass  30 Apr 2012 08:25:31 -0000      1.12
+++ python-distutils-ng.eclass  30 Apr 2012 09:36:48 -0000
@@ -304,11 +304,10 @@
 # Phase function: pkg_pretend
 python-distutils-ng_pkg_pretend() {
        if has "collision-protect" ${FEATURES}; then
-               eerror "Due to previous eclass compiling Python files outside of
src_install"
-               eerror "(and not recording resulting .pyc and .pyo files as
owned by any package)"
-               eerror "merging this package with \"collision-protect\" in
FEATURES will result"
-               eerror "in an error, please switch to using \"protect-owned\"
instead."
-               die "\"collision-protect\" in FEATURES detected"
+               ewarn "Due to previous eclass compiling Python files outside of
src_install"
+               ewarn "(and not recording resulting .pyc and .pyo files as owned
by any package)"
+               ewarn "merging this package with \"collision-protect\" in
FEATURES may result"
+               ewarn "in an error, please switch to using \"protect-owned\"
instead."
        fi
 }

(it's s/eerror/ewarn/ & die removal).

I'm still wondering how many people will read this warning when they hit
collision error.

-- 
Krzysztof Pawlik  <nelchael at gentoo.org>  key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to