[Aptitude-devel] Search term for existence

Martin Stjernholm apt at stjernholm.org
Wed Feb 4 14:35:00 UTC 2009

Daniel Burrows <dburrows at debian.org> wrote:

>> I want to match a package according to condition A, provided there
>> exists some other package that match condition B. (To be useful, the
>> two conditions A and B would incorporate a common variable.)
>   I toyed around with this at the time I introduced binding constructs,
> but I can't remember why I didn't.  Probalby I got distracted by
> something else, or maybe I just couldn't come up with a use case.

My real use case is this:

I want to report auto packages that are ambiguous, i.e. packages that
are satisified by automatic installs that could be satisfied by other
(currently uninstalled) packages as well. This means that the report
should include packages that are provided by both at least one
autoinstalled package and at least one uninstalled package. It'd be
like this using ?exists (linebreaks inserted for readability):

  ?for p: (?=p
           ?exists(?provides(?=p) ?automatic)
           ?exists(?provides(?=p) !?installed))

More information about the Aptitude-devel mailing list