lib/repo: add xbps_repo_remove and use it in xbps_rpool_foreach

https://github.com/void-linux/xbps/issues/3
This commit is contained in:
Duncaen
2019-06-15 19:15:22 +02:00
committed by Juan RP
parent 2ae5dc304b
commit b2f5afd02e
3 changed files with 37 additions and 2 deletions

View File

@ -148,8 +148,10 @@ xbps_rpool_foreach(struct xbps_handle *xhp,
xbps_array_get_cstring_nocopy(xhp->repositories, i, &repouri);
if ((repo = xbps_rpool_get_repo(repouri)) == NULL) {
repo = xbps_repo_open(xhp, repouri);
if (!repo)
if (!repo) {
xbps_repo_remove(xhp, repouri);
continue;
}
SIMPLEQ_INSERT_TAIL(&rpool_queue, repo, entries);
xbps_dbg_printf(xhp, "[rpool] `%s' registered.\n", repouri);
}