[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to obtain current package version number?



On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote:
> Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question
> since /usr/share/doc need not be present, and calling dpkg --list
> $PACKAGE and parsing its output looks like bad overkill.

dpkg -l PACKAGE | awk '$2 ~ /PACKAGE/ { print $3 }'

> Does a maintainer script know the package version, so that it can
> write the version number to a file?

see policy section 6 for the ways in which maintainer scripts are
called.

-- 
gram

Attachment: pgpk3xn12DlFA.pgp
Description: PGP signature


Reply to: