Add the ability to ignore packages
The previous idea was to use virtual packages in the users configuration to satisfy dependencies by mapping them to existing installed packages. Using virtual packages for it doesn't work as expected and trying to make it work would break other functionalities of virtual packages, like the version satisfaction checks for `provides` and the ability to replace virtual packages with real packages. The virtual package functionality should be used exclusively for virtual packages. This allows users to specify packages packages that should be ignored. Ignored packages in dependencies are always satisfied without installing the package, while updating or installing a package that depends on an ignored package. This does NOT ignore the shlib checks, ignoring a package that provides required shared libraries will abort the transaction as if there was no package that provides the required shared library.
This commit is contained in:
@ -512,6 +512,7 @@ struct xbps_handle {
|
||||
* @private
|
||||
*/
|
||||
xbps_array_t preserved_files;
|
||||
xbps_array_t ignored_pkgs;
|
||||
/**
|
||||
* @var repositories
|
||||
*
|
||||
@ -1843,6 +1844,17 @@ bool xbps_verify_file_signature(struct xbps_repo *repo, const char *fname);
|
||||
*/
|
||||
int xbps_pkg_is_installed(struct xbps_handle *xhp, const char *pkg);
|
||||
|
||||
/**
|
||||
* Checks if a package is currently ignored by matching \a pkg.
|
||||
* To be ignored, the pkg must be ignored by the users configuration.
|
||||
*
|
||||
* @param[in] xhp The pointer to an xbps_handle struct.
|
||||
* @param[in] pkg Package name, version pattern or exact pkg to match.
|
||||
*
|
||||
* @return True if the package is ignored, false otherwise.
|
||||
*/
|
||||
bool xbps_pkg_is_ignored(struct xbps_handle *xhp, const char *pkg);
|
||||
|
||||
/**
|
||||
* Returns true if binary package exists in cachedir or in a local repository,
|
||||
* false otherwise.
|
||||
|
Reference in New Issue
Block a user