libxbps: API/ABI break changes to fix issues with virtual packages.
Please see the NEWS file for info about this commit.
This commit is contained in:
@ -285,11 +285,11 @@ repo_find_virtualpkg_cb(struct repository_pool_index *rpi, void *arg, bool *done
|
||||
|
||||
if (rpf->bypattern) {
|
||||
rpf->pkgd =
|
||||
xbps_find_virtualpkg_user_in_dict_by_pattern(rpi->rpi_repod,
|
||||
xbps_find_virtualpkg_conf_in_dict_by_pattern(rpi->rpi_repod,
|
||||
"packages", rpf->pattern);
|
||||
} else {
|
||||
rpf->pkgd =
|
||||
xbps_find_virtualpkg_user_in_dict_by_name(rpi->rpi_repod,
|
||||
xbps_find_virtualpkg_conf_in_dict_by_name(rpi->rpi_repod,
|
||||
"packages", rpf->pattern);
|
||||
}
|
||||
if (rpf->pkgd) {
|
||||
@ -311,9 +311,19 @@ repo_find_pkg_cb(struct repository_pool_index *rpi, void *arg, bool *done)
|
||||
if (rpf->bypattern) {
|
||||
rpf->pkgd = xbps_find_pkg_in_dict_by_pattern(rpi->rpi_repod,
|
||||
"packages", rpf->pattern);
|
||||
/* If no pkg exists matching pattern, look for virtual packages */
|
||||
if (rpf->pkgd == NULL) {
|
||||
rpf->pkgd = xbps_find_virtualpkg_in_dict_by_pattern(
|
||||
rpi->rpi_repod, "packages", rpf->pattern);
|
||||
}
|
||||
} else {
|
||||
rpf->pkgd = xbps_find_pkg_in_dict_by_name(rpi->rpi_repod,
|
||||
"packages", rpf->pattern);
|
||||
/* If no pkg exists matching pattern, look for virtual packages */
|
||||
if (rpf->pkgd == NULL) {
|
||||
rpf->pkgd = xbps_find_virtualpkg_in_dict_by_name(
|
||||
rpi->rpi_repod, "packages", rpf->pattern);
|
||||
}
|
||||
}
|
||||
if (rpf->pkgd) {
|
||||
/*
|
||||
@ -336,9 +346,8 @@ repo_find_best_pkg_cb(struct repository_pool_index *rpi,
|
||||
bool *done)
|
||||
{
|
||||
struct repo_pool_fpkg *rpf = arg;
|
||||
prop_dictionary_t instpkgd, vpkgd;
|
||||
prop_dictionary_t instpkgd;
|
||||
const char *instver, *repover;
|
||||
char *vpattern = NULL;
|
||||
|
||||
rpf->pkgd = xbps_find_pkg_in_dict_by_name(rpi->rpi_repod,
|
||||
"packages", rpf->pattern);
|
||||
@ -369,42 +378,6 @@ repo_find_best_pkg_cb(struct repository_pool_index *rpi,
|
||||
errno = EEXIST;
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* New package version is greater than current installed, but first
|
||||
* check if this is a virtual package and it's set specifically
|
||||
* in the configuration file.
|
||||
*/
|
||||
vpattern = xbps_xasprintf("%s>=0", rpf->pattern);
|
||||
if (vpattern == NULL)
|
||||
return EINVAL;
|
||||
|
||||
vpkgd = xbps_find_virtualpkg_user_in_dict_by_pattern(
|
||||
rpi->rpi_repod, "packages", vpattern);
|
||||
if (vpkgd) {
|
||||
/*
|
||||
* Virtual package enabled in conf file and new
|
||||
* version found.
|
||||
*/
|
||||
free(vpattern);
|
||||
prop_dictionary_set_cstring(vpkgd, "repository",
|
||||
rpi->rpi_uri);
|
||||
*done = true;
|
||||
errno = 0;
|
||||
rpf->pkgfound = true;
|
||||
return 0;
|
||||
} else {
|
||||
/*
|
||||
* Virtual package not enabled in conf file but it's
|
||||
* currently proviving the same virtual package that
|
||||
* we are updating... ignore it.
|
||||
*/
|
||||
if (xbps_find_virtual_pkg_in_dict(rpf->pkgd,
|
||||
vpattern, true)) {
|
||||
free(vpattern);
|
||||
return 0;
|
||||
}
|
||||
free(vpattern);
|
||||
}
|
||||
/*
|
||||
* New package version found, exit from the loop.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user