views:

413

answers:

1

Per the Debian Policy Manual, my postinst script is getting called at upgrade and configure time, as "postinst configure old-version", where old-version is the previously installed version (possibly null). I want to determine new-version, i.e. the version that is currently being configured (upgraded to).

The environment variable $DPKG_MAINTSCRIPT_PACKAGE contains the package name; there does not seem to be an equivalent _VERSION field. /var/lib/dpkg/status gets updated AFTER postinst runs, so I can't seem to parse it out of there, either.

Any ideas?

+3  A: 

Why can't you hard-code the version into the postinst script at packaging time?

Martin v. Löwis
+1: Sounds sensible to me.
R. Bemrose