On 01/02/2013 10:13 PM, Alexandre Rostovtsev wrote:
> On Thu, 2013-01-03 at 00:25 -0500, Rick "Zero_Chaos" Farina wrote:
>> On 01/03/2013 12:06 AM, Michał Górny wrote:
>>> On Wed, 02 Jan 2013 19:49:02 -0800
>>> ""Paweł Hajdan, Jr."" <phajdan...@gentoo.org> wrote:
>>>
>>>> It came up again with <https://bugs.gentoo.org/show_bug.cgi?id=449918>,
>>>> and I think it's worth to think about a better fix. I still keep hitting
>>>> mysterious collisions with orphaned files from time to time.
>>>>
>>>> How about switching the developer profile from collision-protect to
>>>> protect-owned, and proceeding with enabling protect-owned by default for
>>>> all profiles? (not all developers are using the developer profile)
>>>
>>> Well, it all depends.
>>>
>>> protect-owned is easy and lazy. You just get errors on package
>>> collisions, care about nothing else.
>>>
>>> collision-protect cares about every collision. It can help you notice
>>> that *your* package lefts orphaned files for some reason or writes
>>> where it is not supposed to write.
>>>
>> In the years I ran collision-protect I can say it prevented hundreds of
>> merges of linux-firmware (because the kernel also installs firmware) and
>> not much else.
>>
>> Would you be able to share more specific insight on how
>> collision-protect helped protect files that need to be protected where
>> protect-owned would have been inferior?
> 
> It protects files that cannot be owned by any one package, but must still
> be protected, for example /usr/share/glib-2.0/schemas/gschemas.compiled
> 
> This file contains the compiled database of all your gsettings schemas.
> It needs to be updated by running glib-compile-schemas every time you
> install or remove a gsettings schemas xml file. Ebuilds for glib-based
> stuff have to run glib-compile-schemas in pkg_postinst(), and the
> gschemas.compiled must remain outside package manager control.
> 
> However, some packages' build systems have "make" or "make install" call
> glib-compile-schemas by default. A careless developer who doesn't use
> collision-protect *and* doesn't pay attention to protect-owned's warning
> messages might accidentally allow his ebuild to compile and install 
> /usr/share/glib-2.0/schemas/gschemas.compiled in src_install(), marking
> the file as owned by his ebuild. When his ebuild is uninstalled, the
> gschemas.compiled file would be removed, breaking the system.

For special files like these, maybe it makes sense to delegate a single
owner, have that owner do special handling in pkg_preinst. For
gschemas.compiled, the natural owner would be dev-libs/glib:2 since it
installs the glib-compile-schemas program. For special handling in
pkg_preinst, it could do like preserve_old_lib in eutils.eclass, and
copy the existing file from ${ROOT} to ${D}.
-- 
Thanks,
Zac

Reply via email to