Gentoo Archives: gentoo-dev

From: Krzysztof Pawlik <nelchael@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>, Ulrich Mueller <ulm@g.o>
Subject: Re: [gentoo-dev] RFC: new feature to disable merging into stray locations
Date: Mon, 30 Apr 2012 09:38:54
Message-Id: 4F9E5D71.8080409@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: new feature to disable merging into stray locations by "Michał Górny"
1 On 30/04/12 11:28, Michał Górny wrote:
2 > On Mon, 30 Apr 2012 10:23:03 +0200
3 > Krzysztof Pawlik <nelchael@g.o> wrote:
4 >
5 >> On 30/04/12 10:12, Ulrich Mueller wrote:
6 >>>>>>>> On Mon, 30 Apr 2012, Michał Górny wrote:
7 >>>> Since lately Gentoo devs force you to replace collision-protect
8 >>>> with protect-owned [1] and sometimes packages just spit out files
9 >>>> randomly on the filesystem due to random errors, I thought it may
10 >>>> be a good idea to provide a new feature limiting the locations
11 >>>> where packages can install.
12 >>>
13 >>> If the eclass doesn't work with FEATURES="collision-protect" then it
14 >>> needs to be fixed.
15 >>
16 >> Long story short: older eclass compiled Python byte code in live file
17 >> system, new one does it in src_install so .pyo/.pyc gets properly
18 >> recorded, so the package *has to overwrite* files that are not owned
19 >> by anyone (no package owns them). I've talked to Zac and:
20 >>
21 >>>>>
22 >> There's not much else you can do. However, FEATURES="protect-owned" is
23 >> enabled by default, and it will work fine if the .pyo and .pyc files
24 >> are not owned by anything. I don't know why people use
25 >> FEATURES="collision-protect", but at least you can tell them that
26 >> they'll still have a reasonable level of protection from
27 >> FEATURES="protect-owned" (it protect against file collisions between
28 >> packages).
29 >> <<<
30 >>
31 >> If you want to help feel free to suggest *how* to fix it, patches are
32 >> especially welcomed :)
33 >
34 > Just make it warn or something like that. Or even fail but only when
35 > such files exist. There is no point in forcing me to disable
36 > collision-protect when the ebuilds were migrated already.
37
38 Does this work for you:
39
40 $ cvs diff python-distutils-ng.eclass
41 Index: python-distutils-ng.eclass
42 ===================================================================
43 RCS file: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v
44 retrieving revision 1.12
45 diff -u -r1.12 python-distutils-ng.eclass
46 --- python-distutils-ng.eclass 30 Apr 2012 08:25:31 -0000 1.12
47 +++ python-distutils-ng.eclass 30 Apr 2012 09:36:48 -0000
48 @@ -304,11 +304,10 @@
49 # Phase function: pkg_pretend
50 python-distutils-ng_pkg_pretend() {
51 if has "collision-protect" ${FEATURES}; then
52 - eerror "Due to previous eclass compiling Python files outside of
53 src_install"
54 - eerror "(and not recording resulting .pyc and .pyo files as
55 owned by any package)"
56 - eerror "merging this package with \"collision-protect\" in
57 FEATURES will result"
58 - eerror "in an error, please switch to using \"protect-owned\"
59 instead."
60 - die "\"collision-protect\" in FEATURES detected"
61 + ewarn "Due to previous eclass compiling Python files outside of
62 src_install"
63 + ewarn "(and not recording resulting .pyc and .pyo files as owned
64 by any package)"
65 + ewarn "merging this package with \"collision-protect\" in
66 FEATURES may result"
67 + ewarn "in an error, please switch to using \"protect-owned\"
68 instead."
69 fi
70 }
71
72 (it's s/eerror/ewarn/ & die removal).
73
74 I'm still wondering how many people will read this warning when they hit
75 collision error.
76
77 --
78 Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
79 desktop-misc, java, vim, kernel, python, apache...

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies