Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] script to check if a package is installed ?
Date: Fri, 12 Feb 2010 10:00:57
Message-Id: 20100212100040.56feb4ee@digimed.co.uk
In Reply to: Re: [gentoo-user] script to check if a package is installed ? by Alan McKinnon
1 On Fri, 12 Feb 2010 11:38:04 +0200, Alan McKinnon wrote:
2
3 > > Unfortunately eix -I -q CAT/PACK
4 > > produces a return code of 0 irrespectively if CAT/PACK
5 > > is install or not.
6 > >
7 > > I'd like to say
8 > >
9 > > for P in .......; do
10 > > if CHECK_IF_INSTALLED $P; then echo $P; fi
11 > > done
12 > >
13 > > What to replace for CHECK_IF_INSTALLED ?
14 >
15 > check for the existence of /var/db/pkg/$CAT/%PKG-* using test -f
16
17 if [[ "$(eix -I -e cat/pkg)" != "No matches found" ]]; then...
18
19 if [[ -n "$(qlist -Ie cat/pkg)" ]]; then...
20
21
22 --
23 Neil Bothwick
24
25 Anything worth fighting for is worth fighting dirty for.

Attachments

File name MIME type
signature.asc application/pgp-signature