Re: Best way to handle config overrides in packages

2023-03-30 Thread Paul Wise
On Wed, 2023-03-29 at 15:43 +0300, Олег Михайлов wrote:

> I have a case when I need to add multiple configuration files for
> another package into the system as parts of its split config. The
> thing is, I need to remove them when I remove my package because they
> include lines which are only valid when the package is installed.  

There are several ways to do this:

1) make the file in /etc not be a conffile (not policy compliant):

debian/rules:

execute_after_dh_installdeb:
sed -i '\=^/etc/foo/=d' debian/*/DEBIAN/conffiles

2) change the file in /etc so that it works when the package is removed

3) as undef says, move the default config files to /usr

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part


Re: Best way to handle config overrides in packages

2023-03-29 Thread undef

Hi Oleg,

I'd say the best way to handle this would be to work with the package 
maintainer/upstream to allow config files to be specified in 
/usr/share/. This way dpkg will automatically remove the files 
for you.


Before going down that path I did attempt it in /etc/. It was messy but 
the closest thing to a working solution was manually calling 
`mv_conffile` in the postrm script. See 
https://salsa.debian.org/Mobian-team/miniramfs/-/merge_requests/7/diffs 
for an example.




Best way to handle config overrides in packages

2023-03-29 Thread Олег Михайлов
I have a case when I need to add multiple configuration files for another
package into the system as parts of its split config. The thing is, I need
to remove them when I remove my package because they include lines which
are only valid when the package is installed.
Is there any nice way to go about this using dh or anything in the debian
folder of the package?
__
Best Regards,
Oleg