Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Dev

Re: how to determine if a virtual is installed, from the shell?

 

 

Gentoo dev RSS feed   Index | Next | Previous | View Threaded


usata at gentoo

Aug 18, 2003, 11:25 PM

Post #1 of 1 (350 views)
Permalink
Re: how to determine if a virtual is installed, from the shell?

At Tue, 19 Aug 2003 04:43:50 +0200,
Spider wrote:
>
> [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>
http://dev.gentoo.org/~usata/

--
gentoo-dev [at] gentoo mailing list

Gentoo dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.