=head1 NAME

apt-cudf - CUDF solver integration for APT

=head1 SYNOPSIS

=over

=item B<solvername>

=back

=head1 DESCRIPTION

apt-cudf translates back and forth among a CUDF-based dependency solver and the
protocol used by APT to talk with external dependency solvers. apt-cudf
therefore allows one to use any CUDF solver as an external solver for APT.

apt-cudf relies on its C<argv[0]> name to find the CUDF solver to invoke.  In
common setups, you should have a CUDF solver specification file under
F</usr/share/cudf/solvers/> for each installed CUDF solver. To use one such
solver with APT, you should create a symbolic link pointing to
F</usr/bin/apt-cudf> under F</usr/lib/apt/solvers/> and call it with the name
of the CUDF solver you want to use.

=head1 OPTIONS

=over 4

=item -v

=item --verbose

Print debugging information during operation. Can be repeated.

=item -h

=item --help

Show usage information and exit.

=item --version

Show program's version and exit.

=item --dump

Dump the cudf universe and solution

=item --noop

Dump the cudf universe and solution and exit. This is useful to generate a cudf universe from a edsp file

=item --conf

Use a configuration file. Default in /etc/apt-cudf.conf

=item -s <solver>

=item --solver <solver>

Specify the external solver to use.

=item -c <criteria>

=item --criteria <criteria>

Specify the optimization criteria in extended MISC 2012 syntax. This value will
be converted into the optimization criteria language understood by the
respective solver.

As an extension to the MISC 2012 syntax, a variation of the count() measurement
is supported by apt-cudf. The extension allows one to minimize or maximize the
number of packages in a set that have an EDSP field matching a regular
expression. Two formats exist. The first searches for a plain string within the
EDSP field value:

	count(selector,field:=/plain/)

While the second one understands the regular expression syntax of the OCaml
Re_pcre module:

	count(selector,field:~/regex/)

The regex or plain string are delimitered by any character (the slash was
chosen in both above examples) but that character must not be part of the
regex or plain string itself (there is no escaping mechanism).

This option cannot be used together with the B<--criteria-plain> option.

=item --criteria-plain <criteria>

This optimization criteria is passed directly to the solver without any prior
parsing.

This option cannot be used together with the B<--criteria> option.

=item -e

=item --explain

Print a human-readable summary of the solution.

=item --native-arch

Specify the native architecture to be used in the edsp -> cudf translation. By default apt-cudf
uses apt-config to deduce the native architecture. This option is useful if the edsp was generated
on a machine with a different architecture.

=item --foreign-archs

A comma-separated list of foreign architectures to be used in the edsp -> cudf translation

=back

=head1 EXAMPLES

Find a solution for installing the package ghc which minimizes the packages
from experimental:

	APT_EDSP_DUMP_FILENAME=/tmp/dump.edsp apt-get --simulate install --solver dump -o APT::Solver::Strict-Pinning=false ghc
	apt-cudf -v --solver=aspcud -c "-count(solution,APT-Release:=/a=experimental/),-removed,-changed,-new" /tmp/dump.edsp

Usually apt-cudf is not called directly by the user but indirectly by apt-get.
So the above would become:

	apt-get --simulate install --solver aspcud -o APT::Solver::Strict-Pinning=false -o APT::Solver::aspcud::Preferences="-count(solution,APT-Release:=/a=experimental/),-removed,-changed,-new" ghc/experimental

=head1 SEE ALSO

apt-get(8), update-cudf-solvers(8),
L<README.cudf-solvers|file:///usr/share/doc/apt-cudf/README.cudf-solvers>,
L<README.Debian|file:///usr/share/doc/apt-cudf/README.Debian>

=head1 AUTHOR

Copyright: (C) 2011 Pietro Abate <pietro.abate@pps.jussieu.fr>
Copyright: (C) 2011 Stefano Zacchiroli <zack@debian.org>

License: GNU Lesser General Public License (GPL), version 3 or above

=cut
