Class Satsolver::Pool
In: satsolver.i
Parent: Object

The Pool contains information about solvables stored optimized for memory consumption and fast retrieval.

Solvables represent (RPM) packages and are grouped in repositories.

Solving of dependencies works on the Pool, usually with a distinguished repository of installed solvables.

About memory management

Pool should be a Singleton, there is no actual need to have multiple pools.

Since a lot of objects back reference the Pool they belong to, the Pool desctructor is left as a no-op. In the rare case that one has to free memory allocated to a Pool, call discard and do not reference any objects (Repo, Solvable, Solver, …) originating from this Pool.

Methods

Included Modules

Enumerable

Public Class methods

Pool.new → Pool
Pool.new("x86_64") → Pool

Pool creation, optionally with an architecture

If you don‘t pass the architecture to the Pool constructor, you can also use pool.arch= later.

Public Instance methods

:nodoc: Python treats ‘eq’ and ‘ne’ distinct.

Add opened .solv file to pool.

Returns newly created Repository

Add RPM database to Pool.

For chrooted RPM databases, pass the toplevel directory as parameter.

Returns a newly created Repository

Add .solv file to Pool

Returns newly created Repository

Allow self conflicts

If a package can conflict with itself

arch=(p1)

Return number of solvables in the pool

Return the number of repositories in this pool

Create an empty repository, optionally with a name.

This repository should then be populated with Solvables.

Equivalent to: Repo.new

Create an empty Request

Equivalent to: Request.new

Create a solver for this pool

Equivalent to: Solver.new

debug=(p1)

There is no destructor defined for Pool since the pool pointer is mostly used implicitly (e.g. in Solvable or Solver) which cannot be reliably tracked in the bindings.

Deleting the Pool is seldomly needed anyways. Just call Pool::discard to explicitly free the pool. Just remember that Solvables originating from this Pool are invalidated.

Iterate over all solvables in the pool

Interate through all Repositories of this Pool

Find solvable by name.

Optionally restrict search to a Repository.

This function is useful to detect if a Solvable exists at all. If multiple Solvables would match, this call returns any one of them. Use Pool.each_provider to interate over all matches.

Find Repository by name. Returns nil if no Repository with the given name exists.

Get a repository by index from the pool. Returns nil if no such Repository exists.

Implicit obsolete uses provides

installable?(p1)

Return the repository representing the installed solvables. Returns nil if installed= was not called before.

installed=(p1)

Allow virtual conflicts

Obsolete uses provides

Obsolete dependencies usually match on package names only. Setting this flag will make obsoletes also match a provides.

Prepare the pool for solving.

After calling prepare, one must not add or remove Repositories or add/remove Solvables within a Repository.

If epoch should be promoted

promoteepoch=(p1)

Return n‘th provider providing name

INTERNAL

Access Solvable storage within the pool

Get relation based on id from Pool

Return number of Solvables in pool

Access Solvable storage within the pool

Get solvable based on id from pool

solvables()

Get system solvable

This is an internal solvable representing requirements of the system where satsolver is running.

Set the pool to an unprepared status.

You must run Pool.prepare before using a solver on this Pool.

See also Pool.prepare

[Validate]