emacs-devel
[Top][All Lists]
Advanced

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

Re: Obtaining the version of an installed package


From: Stefan Monnier
Subject: Re: Obtaining the version of an installed package
Date: Mon, 09 Aug 2021 11:39:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Bozhidar Batsov [2021-08-09 17:03:21] wrote:
> I guess that could work, although from what I gathered it operates only on
> the current package. I was hoping to find something like an API like
> `(package-get-version 'package-name)`.

Ah, no, we don't have such an abstraction.

Currently, you'd have to use the `package--alist` function (whose first
call will take a bit of time to real all the <FOO>-pkg.el files) and
then look inside its return value with `package-desc-<foo>`.

[ That's assuming you're interested in the packages currently installed.
  If you're interested in the packages currently activated, then you
  have that list in `package-activated-list` but that fails to record
  which version has been activated :-(  ]

Patches welcome to add more friendly accessors.

I'm also curious to know the specific context in which you need that
info.  Is it to test at runtime whether some dependency includes
a particular bugfix/feature ?


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]