Hey Guillem! Thanks for the reply.
On Wed, Sep 11, 2019 at 9:14 PM Guillem Jover <guil...@debian.org> wrote: > Hi! > > On Tue, 2019-09-10 at 16:39:22 -0500, Matt Zagrabelny wrote: > > Package: dpkg > > Version: 1.19.7 > > Severity: wishlist > > > I would like to access other meta data (besides DPKG_HOOK_ACTION) when > > running various pre/post-invoke commands. > > > > Would you consider exposing: > > > > DPKG_HOOK_PACKAGE_NAME > > > > That contains the package name? > > This would only be available for actions that operate on package names, > Sure. That is okay. > or actions that operate on package filenames would get filenames and > not package names. Sure. The filename contains a package name. One could expose any/all of the following (if available): DPKG_HOOK_PACKAGE_FILENAME=/path/to/some.deb DPKG_HOOK_PACKAGE_NAME=foo DPKG_HOOK_PACKAGE_FD=12 > Also these would need to get multiple entries, and > for filenames that might include spaces, so they'd need to be escaped > somehow. Sure. Space separation for multiple package names, filenames, and fd's seems sensible with escaped spaces for filenames. > Or perhaps passed via a file descriptor like apt is doing. > Okay. > I'm curious what would you like to use something like this for? > I'd like to keep track of package upgrades (version, package name, timestamp, etc.) in a relational database for audit purposes. I know I could scrape dpkg.log, but thought it would be more elegant to use a post-invoke hook. Thanks for the dialog! -m