• Bug#1071124: dpkg: post-invoke hook does not run after failure due to n

    From Ben Ferreri@21:1/5 to All on Tue May 14 20:30:01 2024
    XPost: linux.debian.maint.dpkg

    Package: dpkg
    Version: 1.22.6
    Severity: normal
    X-Debbugs-Cc: bferreri@intwineconnect.com

    Dear Maintainer,

    When attempting to install a package as a non-superuser, the configured pre-invoke hook runs, but the post-invoke hook does not. I believe that
    either both hooks should run in this case or neither should.

    For example:

    I have configured both a pre-invoke and post-invoke hook in
    /etc/dpkg/dpkg.cfg.
    I attempt to install a package as a non-root user with `dpkg -i
    mypackage.deb`. The command fails, as expected. However, I observe
    that the pre-invoke hook has run, but the post-invoke hook has not run.

    I would have expected that if the pre-invoke hook ran, the post-invoke
    hook should also have run.



    -- Package-specific info:

    -- System Information:
    Debian Release: trixie/sid
    APT prefers testing
    APT policy: (500, 'testing')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.8.7-arch1-1 (SMP w/8 CPU threads; PREEMPT)
    Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: unable to detect

    Versions of packages dpkg depends on:
    ii libbz2-1.0 1.0.8-5.1
    ii libc6 2.38-10
    ii liblzma5 5.6.1+really5.4.5-1
    ii libmd0 1.1.0-2
    ii libselinux1 3.5-2+b2
    ii libzstd1 1.5.5+dfsg2-2
    ii tar 1.35+dfsg-3
    ii zlib1g 1:1.3.dfsg-3.1

    dpkg recommends no packages.

    Versions of packages dpkg suggests:
    ii apt 2.9.2
    pn debsig-verify <none>

    -- Configuration Files:
    /etc/dpkg/dpkg.cfg changed:
    no-debsig
    log /var/log/dpkg.log
    pre-invoke=/bin/dpkg-hook.sh pre
    post-invoke=/bin/dpkg-hook.sh post


    -- no debconf information

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Guillem Jover@21:1/5 to Ben Ferreri on Wed May 15 02:00:01 2024
    XPost: linux.debian.maint.dpkg

    Hi!

    On Tue, 2024-05-14 at 18:19:18 +0000, Ben Ferreri wrote:
    Package: dpkg
    Version: 1.22.6
    Severity: normal
    X-Debbugs-Cc: bferreri@intwineconnect.com

    When attempting to install a package as a non-superuser, the configured pre-invoke hook runs, but the post-invoke hook does not. I believe that either both hooks should run in this case or neither should.

    For example:

    I have configured both a pre-invoke and post-invoke hook in /etc/dpkg/dpkg.cfg.
    I attempt to install a package as a non-root user with `dpkg -i mypackage.deb`. The command fails, as expected. However, I observe
    that the pre-invoke hook has run, but the post-invoke hook has not run.

    I would have expected that if the pre-invoke hook ran, the post-invoke
    hook should also have run.

    Ah, indeed. Thanks for the report. I've got this fixed locally, but
    I'll ponder a bit more about the correct semantics, when combined with --force-not-root. For --no-act/--dry-run I think it's clear they
    should not be executed though.

    Thanks,
    Guillem

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