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 ?
Many thanks for a hint,
Helmut.
--
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
02-12-2010, 08:38 AM
Alan McKinnon
script to check if a package is installed ?
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
02-12-2010, 09:00 AM
Neil Bothwick
script to check if a package is installed ?
On Fri, 12 Feb 2010 11:38:04 +0200, Alan McKinnon wrote:
> > 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
if [[ "$(eix -I -e cat/pkg)" != "No matches found" ]]; then...
if [[ -n "$(qlist -Ie cat/pkg)" ]]; then...
--
Neil Bothwick
Anything worth fighting for is worth fighting dirty for.