lib: tighten repolock

when repolocked package has newer version in other repository and other
package depend on that newer version, repolocked package was updated and
swiched to other repo, while repolock status was left enabled
This commit is contained in:
Piotr Wójcik authored and Duncan Overbruck committed 2021-09-10 14:40:02 +02:00
1 parent ee2b5fb56f
commit 59ea6a5388
1 file changed
+17 -2
+17 -2
View File
@@ -308,8 +308,23 @@ repo_deps(struct xbps_handle *xhp,
* If dependency does not match add pkg into the missing
* deps array and pass to next one.
*/
if (((curpkgd = xbps_rpool_get_pkg(xhp, reqpkg)) == NULL) &&
((curpkgd = xbps_rpool_get_virtualpkg(xhp, reqpkg)) == NULL)) {
if (xbps_dictionary_get(curpkgd, "repolock")) {
const char *repourl = NULL;
struct xbps_repo *repo = NULL;
xbps_dbg_printf(xhp, "`%s' is repolocked, looking at single repository.\n", reqpkg);
xbps_dictionary_get_cstring_nocopy(curpkgd, "repository", &repourl);
if (repourl && (repo = xbps_regget_repo(xhp, repourl))) {
curpkgd = xbps_repo_get_pkg(repo, reqpkg);
} else {
curpkg = NULL;
}
} else {
curpkgd = xbps_rpool_get_pkg(xhp, reqpkg);
if (!curpkgd) {
curpkgd = xbps_rpool_get_virtualpkg(xhp, reqpkg);
}
}
if (curpkgd == NULL) {
/* pkg not found, there was some error */
if (errno && errno != ENOENT) {
xbps_dbg_printf(xhp, "failed to find pkg for `%s' in rpool: %s\n", reqpkg, strerror(errno));