Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] script to check if a package is installed ?
Date: Fri, 12 Feb 2010 09:40:27
Message-Id: 201002121138.04315.alan.mckinnon@gmail.com
In Reply to: [gentoo-user] script to check if a package is installed ? by Helmut Jarausch
1 On Friday 12 February 2010 11:16:22 Helmut Jarausch wrote:
2 > Hi,
3 >
4 > does anybody know how to check if a package is installed using a script/
5 > shell.
6 >
7 > Unfortunately eix -I -q CAT/PACK
8 > produces a return code of 0 irrespectively if CAT/PACK
9 > is install or not.
10 >
11 > I'd like to say
12 >
13 > for P in .......; do
14 > if CHECK_IF_INSTALLED $P; then echo $P; fi
15 > done
16 >
17 > What to replace for CHECK_IF_INSTALLED ?
18
19 check for the existence of /var/db/pkg/$CAT/%PKG-* using test -f
20
21 This is not 100% accurate though, as kdebase-menu returns positive if kdebase-
22 menu-icons is installed and kdebase-menu is not
23
24 --
25 alan dot mckinnon at gmail dot com

Replies

Subject Author
Re: [gentoo-user] script to check if a package is installed ? Neil Bothwick <neil@××××××××××.uk>