• Best way to handle config overrides in packages

    From =?UTF-8?B?0J7Qu9C10LMg0JzQuNGF0LDQu@21:1/5 to All on Wed Mar 29 15:10:01 2023
    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

    <div dir="ltr"><div>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.  <br></div><div>Is there any nice way to go about this using dh or anything in the debian folder of the package?</div><div>__</div><div>Best Regards,</div><div>        Oleg<br></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From undef@21:1/5 to All on Wed Mar 29 23:20:01 2023
    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/<package>. 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Wise@21:1/5 to All on Thu Mar 30 14:20:02 2023
    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

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmQlfVUACgkQMRa6Xp/6 aaOYgQ//felAeMGuQ7AX4/mJBLYlXy6UNDYdk2+FS+1/vVZzVBq7RZY/Qy3b04QR nUwjMqxvxhN1PLtxTeu+kXMKGys5OA7zELlk7XCqOzzhhEk3Ly/6WyRrYVeFVJjL YHh22RlzmjkNvBhyyRL63s7AyG0x+1VIHgAjV1zTvjNV8fx0X97lzOIec9OTYl6s HQfArZblqYryG/yWZQHq2lpwvEqFl9dbnXklOhNq8PG/OuO65qUION+dgwg4Swum J0MEI+vgSjcUqOnZGOyOAaxdIxPuM72YkwD5mkaYHzb+MkkmdiLQSCKAKmQ89S2+ jNhGVBVyKDabOT02w55Gej2OUzq1lve5DLKBuhEFUEIgMLUh3o1SqLnz3RImiHZd o8KfC6VOPw1y2LQMftGhtj/Ao1jGN9WoF02UKSqq10KZTUG94TWilYxnqmOk9qnf dkKd1IId+aPiWhOWjL0HHvmMelZrDF0Lj0bgF2Aj7YiicFEgmrfne9G6sKfoK0rd 7o8E+HYZ079zxP65bslSZPKtK1cjkGyPM6gGK+G8pWG2H/R2rcOyouKKsUUINlfm DvrS0KSyB7Gxdk7KBg4SMCf8IAIdU/poc17XBM/D+r8bua6ZCVElJ94dscRhW829 AhggLTfQSk9Pl0znpbGpDmvRM0xkyZ8BLQWgGbv/3znYZ01LYkk=
    =binU
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)