Skip to content

Add a strict mode for package installs

Edmund Smith requested to merge eds-collabora/pacman:pacman-strict into master

When installing packages via automation, it can be important to ensure that the packages expected are installed. At present, if no exact match for the requested name exists, a provider of that name will instead be installed. This can lead to unexpected consequences as the package pool evolves.

An example of where this is the case is the following: in the event we wish to install AUR packages from an unsanctioned or derivative repository, we may initially get the package we expect by requesting a name that that package provides, e.g. foo-aur may provide foo and we may install it as foo. If the package is subsequently added to another repository with the name we have requested (i.e. a real foo package emerges), an automated build or other process may switch to that package without warning. This can subvert the expected hierarchy of repositories (i.e. a nightly build process starts installing a package from a lower priority repository without warning).

This patch lets us ensure that packages are installed via the names we expect. It is opt-in: if you pass -x, or --strict to -S then packages that only provide the given targets will not be considered, only packages that are named for the given targets. It is not likely to be useful for end-users, but it is helpful for automated build environments and other situations where clarity is more important than convenience.

Signed-off-by: Ed Smith ed.smith@collabora.com

Merge request reports