libxbps: fix for vpkg providers in multiple repos.
Added new test case by @st3r4g via #206 Closes #206
This commit is contained in:
11
lib/repo.c
11
lib/repo.c
@@ -398,8 +398,7 @@ xbps_repo_get_virtualpkg(struct xbps_repo *repo, const char *pkg)
|
||||
|
||||
pkgd = xbps_find_virtualpkg_in_dict(repo->xhp, repo->idx, pkg);
|
||||
if (pkgd) {
|
||||
xbps_dictionary_set_cstring_nocopy(pkgd,
|
||||
"repository", repo->uri);
|
||||
xbps_dictionary_set_cstring_nocopy(pkgd, "repository", repo->uri);
|
||||
return pkgd;
|
||||
}
|
||||
return NULL;
|
||||
@@ -417,14 +416,14 @@ xbps_repo_get_pkg(struct xbps_repo *repo, const char *pkg)
|
||||
return NULL;
|
||||
|
||||
/* Try matching vpkg from configuration files */
|
||||
if ((pkgd = xbps_find_virtualpkg_in_conf(repo->xhp, repo->idx, pkg)))
|
||||
if ((pkgd = xbps_find_virtualpkg_in_conf(repo->xhp, repo->idx, pkg))) {
|
||||
xbps_dictionary_set_cstring_nocopy(pkgd, "repository", repo->uri);
|
||||
return pkgd;
|
||||
|
||||
}
|
||||
/* ... otherwise match a real pkg */
|
||||
pkgd = xbps_find_pkg_in_dict(repo->idx, pkg);
|
||||
if (pkgd) {
|
||||
xbps_dictionary_set_cstring_nocopy(pkgd,
|
||||
"repository", repo->uri);
|
||||
xbps_dictionary_set_cstring_nocopy(pkgd, "repository", repo->uri);
|
||||
return pkgd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user