• Bug#1085224: dpkg: Please clarify Conffiles list output from dpkg --sta

    From Guillem Jover@1:229/2 to Nis Martensen on Sat Oct 19 06:10:01 2024
    XPost: linux.debian.bugs.dist
    From: guillem@debian.org

    Hi!

    On Wed, 2024-10-16 at 22:34:34 +0200, Nis Martensen wrote:
    Package: dpkg
    Version: 1.22.11
    Severity: wishlist
    X-Debbugs-Cc: nis.martensen@web.de

    Reportbug uses `dpkg --status $package` to collect information about a package, including the list of configuration files. It assumes that the output in each line under Conffiles is always a space-separated tuple of filename and md5sum. However, this is not always true, as indicated in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1080336

    Ah, if this was due to the remove-on-upgrade, that is only documented
    by proxy in deb-conffiles(5).

    What should users of the dpkg --status output expect regarding the
    conffiles list? E.g., how many fields can there be on each line? Why are non-existent files sometimes included in the list? See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085130
    for an example of confusion. When can removed configuration files be
    expected to no longer be listed?

    Right, there is missing documentation for this. The entries always have
    at least two elements separated by a space, the filename and its
    md5sum from the .deb (or «newconffile» if the file was not present on
    the .deb). The entries can have an optional flag element that can be
    either «obsolete» or «remove-on-upgrade».

    The conffiles can be missing because they have been cleaned up by a maintscript, or removed during upgrade due to the «remove-on-upgrade»
    flag, but can also be missing because the local admin has removed them
    (which counts as a normal user modification to be preserved), so
    programs should not error out if a conffile is missing (dpkg does not).

    Currently there might be entries for obsolete conffiles left behind,
    but those will be "garbage collected" the next time a package is
    configured and the conffiles are not on disk anymore.

    I'm wondering if reportbug should be changed to notice when the remove-on-upgrade flag is printed and then ignore the corresponding line.

    It should never error out on missing conffiles. It might be nice to
    still print that the file is not present (with a nicer error than
    ENOENT) though. For obsolete and remove-on-upgrade it might make sense
    to print the conffiles in case they are present (as an abnormality)
    and otherwise not even present them at all?

    Clarification or advice is appreciated. Would the deb-conffiles man page
    be a good place to add clarifying documentation? Thanks!

    I don't think deb-conffiles(5) would be the correct place. Probably
    adding a section for some of the internal dpkg fields into
    dpkg-query(1), before the description of the virtual fields might make
    sense. So I'll try to do that.

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Vincent Lefevre@1:229/2 to Nis Martensen on Wed Apr 16 13:00:02 2025
    XPost: linux.debian.bugs.dist
    From: vincent@vinc17.net

    On 2024-10-19 11:02:56 +0200, Nis Martensen wrote:
    `dpkg --status procps` on current sid now includes this line:
    /etc/sysctl.conf 72b7c827a9636cda7b3b371091ff2dce remove-on-upgrade

    After running `apt install --reinstall procps` the corresponding line in
    the `dpkg --status procps` output looks like this:
    /etc/sysctl.conf newconffile remove-on-upgrade

    Does it mean the conffile will always be listed in the output as long as
    it is listed in DEBIAN/conffiles, even if the «remove-on-upgrade» flag
    has been present across several package upgrades? Or does the line only
    not get dropped here because what I did was a reinstall and not an upgrade?

    This line is also present after an upgrade:

    qaa:~> dpkg -s procps
    Package: procps
    Status: install ok installed
    Priority: important
    Section: admin
    Installed-Size: 2395
    Maintainer: Craig Small <csmall@debian.org>
    Architecture: amd64
    Multi-Arch: foreign
    Version: 2:4.0.4-8
    [...]
    Conffiles:
    /etc/sysctl.conf newconffile remove-on-upgrade
    /etc/init.d/procps f9903aa0d9f2f10714269befb4cdba8f
    /etc/sysctl.d/README.sysctl 93eda3f215e9d29316f5597cb4551082
    [...]

    IMHO, this is a bug, whether the package has been reinstalled or
    upgraded. There is no point to output such a line for a conffile
    that definitively no longer exists. About this issue:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085130

    --
    Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
    100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
    Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)