Re: pkg question: how to patch a startup file, but make it so that an upgrade to the package still overwrites it

From: Xin Li <delphij_at_delphij.net>
Date: Tue, 27 Sep 2022 07:35:29 UTC

On 9/26/22 18:44, Dan Mahoney wrote:
> All,
> 
> At the day job we've found a bug in an rcfile (for open-vm-tools), that conflicts with our puppet install.  We've already told the pkg maintainer, pointed out the problem, might also go ahead and file a pr so there's an available patch.
> 
> In the mean time, all our puppet runs are reporting failures because of this.
> 
> Is there a "correct" way to change the main rc.d file, but still have it such that a new version of the pkg will overwrite this with a fixed version?  I know that pkg normally will refuse to delete a file in /usr/local/etc that has local changes.

I'm pretty sure that pkg would overwrite the rc.d files regardless if 
there is local change, upon upgrade.

If you are in doubt, you can modify it, and try 'pkg install -f 
<package>' to emulate the effect.

pkg normally does not overwrite configuration files, this is implemented 
by comparing the contents against the .dist or .sample contents, and 
only remove when they are identical upon removal, and have the 
installation process to only copy the sample file to the actual 
configuration file when it doesn't exist.  This is not the typical case 
for rc.d files, which are similar to any binaries installed by the package.

Cheers,