lib/register.c: add some DPRINTFs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100313083102-cz4hwmd94uuh5awv
This commit is contained in:
Juan RP 2010-03-13 09:31:02 +01:00
parent 6eebced6b4
commit fa9d8c718a

View File

@ -76,24 +76,29 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
"packages", pkgname);
if (pkgd == NULL) {
rv = errno;
DPRINTF(("%s: find_pkg_in_dict_by_name failed: %s\n",
__func__, strerror(rv)));
goto out;
}
if (!prop_dictionary_set_cstring_nocopy(pkgd,
"version", version)) {
prop_object_release(pkgd);
rv = errno;
DPRINTF(("%s: version obj not found!\n", __func__));
goto out;
}
if (!prop_dictionary_set_cstring_nocopy(pkgd,
"pkgver", pkgver)) {
prop_object_release(pkgd);
rv = errno;
DPRINTF(("%s: pkgver obj not found!\n", __func__));
goto out;
}
if (!prop_dictionary_set_cstring_nocopy(pkgd,
"short_desc", desc)) {
prop_object_release(pkgd);
rv = errno;
DPRINTF(("%s: short_desc obj not found!\n", __func__));
goto out;
}
if (!prop_dictionary_get_bool(pkgd,
@ -102,6 +107,8 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
"automatic-install", automatic)) {
prop_object_release(pkgd);
rv = errno;
DPRINTF(("%s: autoinst obj not found!\n",
__func__));
goto out;
}
}
@ -114,11 +121,15 @@ xbps_register_pkg(prop_dictionary_t pkgrd, bool automatic)
if (array == NULL) {
prop_object_release(pkgd);
rv = ENOENT;
DPRINTF(("%s: packages array obj not found!\n",
__func__));
goto out;
}
rv = xbps_requiredby_pkg_add(array, pkgrd);
if (rv != 0) {
prop_object_release(pkgd);
DPRINTF(("%s: requiredby_pkg_add failed %d\n",
__func__, rv));
goto out;
}
}