libxbps: separate virtualpkg conf stuff from repository_pool_find_pkg.

Now to find a virtualpkg set by the user in conf file, there is a new
function: xbps_repository_pool_find_virtualpkg(). Use it in some
places to make jpeg -> libjpeg-turbo (and other pkgs that can be
replaced with other virtual pkgs) work correctly even if installed
multiple times.
This commit is contained in:
Juan RP
2011-10-16 12:22:46 +02:00
parent 104bec27e5
commit 12af2370da
5 changed files with 125 additions and 59 deletions

View File

@@ -87,10 +87,14 @@ repository_find_pkg(const char *pattern, const char *reason)
pkg_repod = xbps_repository_pool_find_pkg(pattern,
bypattern, bestpkg);
if (pkg_repod == NULL) {
/* not found */
rv = errno;
errno = 0;
goto out;
pkg_repod = xbps_repository_pool_find_virtualpkg(pattern,
bypattern, bestpkg);
if (pkg_repod == NULL) {
/* not found */
rv = errno;
errno = 0;
goto out;
}
}
/*
* Prepare transaction dictionary and missing deps array.