On Friday 12 February 2010 11:16:22 Helmut Jarausch wrote: > Hi, > > does anybody know how to check if a package is installed using a script/ > shell. > > Unfortunately eix -I -q CAT/PACK > produces a return code of 0 irrespectively if CAT/PACK > is install or not. > > I'd like to say > > for P in .......; do > if CHECK_IF_INSTALLED $P; then echo $P; fi > done > > What to replace for CHECK_IF_INSTALLED ?
check for the existence of /var/db/pkg/$CAT/%PKG-* using test -f This is not 100% accurate though, as kdebase-menu returns positive if kdebase- menu-icons is installed and kdebase-menu is not -- alan dot mckinnon at gmail dot com