On 09/04/2013 12:44 PM, Gilles Dartiguelongue wrote:
> Le mercredi 04 septembre 2013 à 15:23 -0400, Ian Stakenvicius a écrit :
>> If you want to do that *and* maintain whatever is currently in that
>> file, you can use the trick sys-apps/openrc used to do:  in
>> pkg_preinst, copy the system file (if it exists) into ${D}, and then
>> let that same copy be merged back into the system.  Openrc did it to
>> get around CONFIG_PROTECT, but it had the unfortunate side effect of
>> making the package own the file.  I don't know if removal will be
>> affected by this though if the contents of the file change after the
>> ebuild owning it was merged?
> 
> That sounds like a good idea, I guess it does not cause a
> collision-protect error because the file is added to ${D} after
> comparison between ${D} and live file-system ? 

Right. The collision check happens _before_ pkg_preinst, so it's
possible to create a file in ${D} during pkg_preinst in order to fool
collision-protect.
-- 
Thanks,
Zac

Reply via email to