Subject: Re: bug#39650: wish: search shows whether a package is installed

From: zimoun <[email-masked]>
Date: Mon, 17 Feb 2020 23:33:51 +0100

Hi Arne,

On Mon, 17 Feb 2020 at 23:16, Arne Babenhauserheide <[email-masked]> wrote:

> It would be great if `guix search TERMS` could show for each record
> whether the package is installed and which versions are installed.

I agree.
Say if it is already in '/gnu/store' is often helpful.

And "guix search" should even provide in which profile it is already installed
(maybe even in which generation of which profile it is already)

> I regularly search for a library and then check with guix package -I
> whether I already have it, and that’s quite inconvenient.

In the meantime, something along these lines should do the trick...

--8<---------------cut here---------------start------------->8---
for profile in $(guix package --list-profiles)
do
    echo $profile
    guix package -p $profile -I | grep <pkg>
done
--8<---------------cut here---------------end--------------->8---

and it is not convenient, I agree. :-)

All the best,
simon