[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to test the presence of packages ?



Il giorno mar, 03/01/2012 alle 18.56 +0100, fred0a@free.fr ha scritto:
> 
> ----- Mail original -----
> De: "Michael Shuler" <michael@pbandjelly.org>
> À: debian-mentors@lists.debian.org
> Envoyé: Mardi 3 Janvier 2012 18:44:42
> Objet: Re: How to test the presence of packages ?
> 
> On 01/03/2012 11:38 AM, fred0a@free.fr wrote:
> > What's the way to take, to test the presence of a list of packages
> > and to install one package or more in case where none are already
> > installed ?
> 
> This is handled by declaring package relationships via Depends:,
> Recommends:, etc.
> 
> http://www.debian.org/doc/debian-policy/ch-relationships.html
> 
> --
> Kind regards,
> Michael
> 
> 
> Yes, I already reads this page but it does not answer to my problem.
> Here an example of what I want:
> 
> Test if package1, package2, package3 and package4 is installed.
> * If one of this list is already iinstalled then do nothing.
> * If none is installed then install package2 and package3 for example.
> 
> 

The example doesn't make much sense because if package2 and package3 are
both required for your package to work, then "one of the list" is not
enough.

Replacing "If none is installed then install package2 and package3" with
"If none is installed then isntall package2", then the solution is:

Depends: package2 | package1 | package3 | package4

Replacing "If one of this list is already installed" with "If at least
two out of this list are already installed"... then a simple Depends is
not enough. Theoretically, one can solve the problem with virtual/dummy
packages... but I think you'd better just expose your use case to
understand what your problem is.

Pietro


Reply to: