xbps_init: add a debug printf if repository array in conf file is empty.
This commit is contained in:
parent
36346a7ca0
commit
47e3a3f39b
@ -82,7 +82,10 @@ xbps_init(struct xbps_handle *xh)
|
|||||||
* Initialize repository pool.
|
* Initialize repository pool.
|
||||||
*/
|
*/
|
||||||
if ((rv = xbps_repository_pool_init()) != 0) {
|
if ((rv = xbps_repository_pool_init()) != 0) {
|
||||||
if (rv != ENOENT) {
|
if (rv == ENOTSUP) {
|
||||||
|
xbps_dbg_printf("%s: empty repository list.\n",
|
||||||
|
__func__);
|
||||||
|
} else if (rv != ENOENT && rv != ENOTSUP) {
|
||||||
xbps_dbg_printf("%s: couldn't initialize "
|
xbps_dbg_printf("%s: couldn't initialize "
|
||||||
"repository pool: %s\n", strerror(rv));
|
"repository pool: %s\n", strerror(rv));
|
||||||
xbps_end();
|
xbps_end();
|
||||||
|
@ -67,10 +67,12 @@ xbps_repository_pool_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
array = prop_dictionary_get(xhp->conf_dictionary, "repositories");
|
array = prop_dictionary_get(xhp->conf_dictionary, "repositories");
|
||||||
if (array == NULL) {
|
if (array == NULL)
|
||||||
rv = errno;
|
return errno;
|
||||||
goto out;
|
|
||||||
}
|
if (prop_array_count(array) == 0)
|
||||||
|
return ENOTSUP;
|
||||||
|
|
||||||
iter = prop_array_iterator(array);
|
iter = prop_array_iterator(array);
|
||||||
if (iter == NULL) {
|
if (iter == NULL) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
|
Loading…
Reference in New Issue
Block a user