libxbps: only initialize repository pool in repository_pool_foreach, fix a bug.

In xbps_repository_pool_init, xbps_fetch_file() returns 1 when a file is
successfully fetched and that var was used to check for successful initialization.
This commit is contained in:
Juan RP 2011-06-24 21:20:06 +02:00
parent 97fcd43bbe
commit 532edaddda

View File

@ -120,6 +120,7 @@ xbps_repository_pool_init(void)
free(plist);
goto out;
}
rv = 0;
}
}
ntotal++;
@ -369,20 +370,6 @@ xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best)
int rv = 0;
assert(pkg != NULL);
/*
* Initialize repository pool.
*/
if ((rv = xbps_repository_pool_init()) != 0) {
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 "
"repository pool: %s\n", __func__, strerror(rv));
}
xbps_end();
return NULL;
}
rpf = calloc(1, sizeof(*rpf));
if (rpf == NULL)