Add repos set in xbps_handle::repositories to the top of the list.

That means that now xbps-install(8) and xbps-query(8) --repository
option does not override the repository list of a configuration file.
This commit is contained in:
Juan RP
2013-12-04 16:59:15 +01:00
parent d98468515a
commit 4403caa434
4 changed files with 18 additions and 16 deletions

View File

@ -172,17 +172,14 @@ xbps_init(struct xbps_handle *xhp)
}
}
/*
* If repositories array is empty use the provided list from
* configuration file.
* Append repository list specified in configuration file.
*/
if (xbps_array_count(xhp->repositories) == 0) {
for (unsigned int i = 0; i < cfg_size(xhp->cfg, "repositories"); i++) {
if (xhp->repositories == NULL)
xhp->repositories = xbps_array_create();
for (unsigned int i = 0; i < cfg_size(xhp->cfg, "repositories"); i++) {
if (xhp->repositories == NULL)
xhp->repositories = xbps_array_create();
repodir = cfg_getnstr(xhp->cfg, "repositories", i);
xbps_array_add_cstring_nocopy(xhp->repositories, repodir);
}
repodir = cfg_getnstr(xhp->cfg, "repositories", i);
xbps_array_add_cstring_nocopy(xhp->repositories, repodir);
}
if (xhp->cachedir == NULL) {