usata at gentoo
Aug 18, 2003, 11:25 PM
Post #1 of 1
At Tue, 19 Aug 2003 04:43:50 +0200,
Re: how to determine if a virtual is installed, from the shell?
> [1 <text/plain; US-ASCII (7bit)>]
> begin quote
> On Mon, 18 Aug 2003 22:31:47 -0400
> Owen Gunden <ogunden [at] stwing> wrote:
> > So hypothetically, if I wanted to write a shell script that behaved
> > differently if virtual/mta was installed than if it was not, what
> > would I do?
> cat /var/cache/edb/virtuals ... this should give you the format
> enough to work shell magic with it :)
Alternatively, you can use has_version function. If you want to use
it from normal shell script (not an ebuild), use
/usr/bin/portageq has_version / 'virtual/mta' && ...
See man 5 ebuild for more detail.
Mamoru KOMACHI <usata [at] gentoo>
gentoo-dev [at] gentoo mailing list