repository_pool_find_pkg: added some dbg printf, calloc -> malloc.
There's no need to use calloc here because some members are being initialized anyway, so fully initialize all members and skip the memset syscall via calloc.
This commit is contained in:
parent
e37a9efb74
commit
a59f48585f
@ -278,6 +278,10 @@ repo_find_virtualpkg_cb(struct repository_pool_index *rpi, void *arg, bool *done
|
|||||||
"packages", rpf->pattern);
|
"packages", rpf->pattern);
|
||||||
}
|
}
|
||||||
if (rpf->pkgd) {
|
if (rpf->pkgd) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
xbps_dbg_printf("%s: found pkg in repository\n", __func__);
|
||||||
|
xbps_dbg_printf_append("%s", prop_dictionary_externalize(rpf->pkgd));
|
||||||
|
#endif
|
||||||
prop_dictionary_set_cstring(rpf->pkgd, "repository",
|
prop_dictionary_set_cstring(rpf->pkgd, "repository",
|
||||||
rpi->rpi_uri);
|
rpi->rpi_uri);
|
||||||
*done = true;
|
*done = true;
|
||||||
@ -315,6 +319,10 @@ repo_find_pkg_cb(struct repository_pool_index *rpi, void *arg, bool *done)
|
|||||||
* Package dictionary found, add the "repository"
|
* Package dictionary found, add the "repository"
|
||||||
* object with the URI.
|
* object with the URI.
|
||||||
*/
|
*/
|
||||||
|
#ifdef DEBUG
|
||||||
|
xbps_dbg_printf("%s: found pkg in repository\n", __func__);
|
||||||
|
xbps_dbg_printf_append("%s", prop_dictionary_externalize(rpf->pkgd));
|
||||||
|
#endif
|
||||||
prop_dictionary_set_cstring(rpf->pkgd, "repository",
|
prop_dictionary_set_cstring(rpf->pkgd, "repository",
|
||||||
rpi->rpi_uri);
|
rpi->rpi_uri);
|
||||||
*done = true;
|
*done = true;
|
||||||
@ -388,12 +396,14 @@ xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best)
|
|||||||
|
|
||||||
assert(pkg != NULL);
|
assert(pkg != NULL);
|
||||||
|
|
||||||
rpf = calloc(1, sizeof(*rpf));
|
rpf = malloc(sizeof(*rpf));
|
||||||
if (rpf == NULL)
|
if (rpf == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
rpf->pattern = pkg;
|
rpf->pattern = pkg;
|
||||||
rpf->bypattern = bypattern;
|
rpf->bypattern = bypattern;
|
||||||
|
rpf->pkgfound = false;
|
||||||
|
rpf->pkgd = NULL;
|
||||||
|
|
||||||
if (best) {
|
if (best) {
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user