[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 02:14:59PM +0100, Bastian Kleineidam wrote:
> On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote:
> > how can a package learn about its current version number?
> 
> Package information is stored in /var/lib/dpkg/available.

Information about what's installed is in /var/lib/dpkg/status, not
/var/lib/dpkg/available.

> > Does a maintainer script know the package version, so that it can
> > write the version number to a file?
> # example: current bash version number
> BASH_VERSION=`grep-available -P -s Version -n -r '^bash$'`

That will be wrong in the event that somebody has run 'dselect update'
but not yet upgraded.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: