#1007089 please consider definint DPKG_MAINTSCRIPT_OPERATION

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Marc Haber
Date:
2026-01-10 11:39:48 UTC
Severity:
wishlist
#1007089#5
Date:
2022-03-10 21:39:14 UTC
From:
To:
Dear Maintainer,

it would be useful if Debian-specific programs called from a maintainer
script would know which dpkg operation (i.e.  install / upgrade /
configure / remove / purge) is currently being executed.

For example, a future enhanced version of deluser might have functions
to lock an account on uninstall and remove it on purge of the
requesting package.

Currently, that would need postrm code like

case "$1" in
  uninstall)
    deluser --uninstall $user
    ;;
  purge)
    deluser --purge $user
    ;;
esac

If dpkg would define an environment variable DPKG_MAINTSCRIPT_OPERATION
in addition to the already existing DPKG_MAINTSCRIPT_NAME, a simple cal
of deluser --system $user could know by itself whether it is called from
a postrm executing an uninstall or a purge operation and behave
appropriately.

I am pretty sure that I could come up with other usecases that would
augment the already existing DPKG_MAINTSCRIPT_* envvars, it's just the
operation that seems to be missing.

Thanks for considering.

Greetings
Marc

#1007089#12
Date:
2026-01-10 10:08:19 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.