# Package Modeling

## Constraint Satisfaction

### Constraint Types

Dependency resolution involves satisfaction of many constraints:

- Persistent configuration parameters, like those that come from make.profile, make.conf, and the /etc/portage directory.

- Current command parameters, which may include options, atoms, or sets.

- Package Dependencies

### Package Dependencies

Common types of package dependencies:

- Files required for building or installing. Downloads may be necessary to satisfy these.

- Other packages required to be installed for buildtime or runtime.

- Blockers that prevent conflicting packages from being installed simultaneously.

## Conflicts

### Blocker Conflicts

If one package blocks another package, the two packages conflict such that they cannot be installed simultaneously. These conflicts are often due to file collisions. In some cases, packages that block each other can be temporarily installed simultaneously. In order to resolve file collisions that occur between two blocking packages that are installed simultaneously, the overlapping files must be removed from the contents list of the package which was installed first.

Some cases may exist such that temporary simultaneous installation of blocking packages will cause some sort of problem. However, this type of solution will only be chosen for blockers that can not be satisfied in any other way, such as by simple adjustment of merge order. In addition, this type of solution will not be chosen if a blocking package will overwrite files belonging to packages from the system set, or packages that are runtime dependencies of Portage itself. These constraints serve to limit the probability that a chosen solution will cause an unforeseen problem.

### Slot Conflicts

If two different packages that occupy the same slot are chosen to satisfy dependencies, a slot conflict occurs. The two packages cannot be installed simultaneously and therefore the respective dependencies will not be satisfied simultaneously.

### Indirect Conflicts

If the dependencies of two parent packages cannot be installed simultaneously, it creates an indirect conflict between the parent packages since their respective dependencies cannot be satisfied simultaneously.

## Dependency Neglection

In order to significantly reduce the resources consumed by the modeling process, the dependencies of installed packages may be neglected.

If a more complete dependency calculation is desired, there is a --complete-graph option which will ensure that the dependencies of installed packages are properly considered.