libxbps: more dbg printf love.
This commit is contained in:
parent
85c58e77c2
commit
70dd86e2df
@ -36,7 +36,6 @@
|
|||||||
* @file lib/init_virtualpkg.c
|
* @file lib/init_virtualpkg.c
|
||||||
* @brief Initialization of virtual package settings.
|
* @brief Initialization of virtual package settings.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void HIDDEN
|
void HIDDEN
|
||||||
xbps_init_virtual_pkgs(struct xbps_handle *xh)
|
xbps_init_virtual_pkgs(struct xbps_handle *xh)
|
||||||
{
|
{
|
||||||
@ -64,8 +63,8 @@ xbps_init_virtual_pkgs(struct xbps_handle *xh)
|
|||||||
*/
|
*/
|
||||||
dirp = opendir(prop_string_cstring_nocopy(vpkgdir));
|
dirp = opendir(prop_string_cstring_nocopy(vpkgdir));
|
||||||
if (dirp == NULL) {
|
if (dirp == NULL) {
|
||||||
xbps_dbg_printf("%s: cannot access to %s for virtual "
|
xbps_dbg_printf("[init_virtualpkgs] cannot access "
|
||||||
"packages: %s\n", __func__,
|
"to %s for virtual packages: %s\n",
|
||||||
prop_string_cstring_nocopy(vpkgdir),
|
prop_string_cstring_nocopy(vpkgdir),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
prop_object_release(vpkgdir);
|
prop_object_release(vpkgdir);
|
||||||
@ -82,29 +81,30 @@ xbps_init_virtual_pkgs(struct xbps_handle *xh)
|
|||||||
vpkgfile = xbps_xasprintf("%s/%s",
|
vpkgfile = xbps_xasprintf("%s/%s",
|
||||||
prop_string_cstring_nocopy(vpkgdir), dp->d_name);
|
prop_string_cstring_nocopy(vpkgdir), dp->d_name);
|
||||||
if (vpkgfile == NULL) {
|
if (vpkgfile == NULL) {
|
||||||
xbps_dbg_printf("%s: failed to alloc mem for %s\n",
|
xbps_dbg_printf("[init_virtualpkgs] failed to "
|
||||||
__func__, dp->d_name);
|
"alloc mem for %s\n", dp->d_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
vpkgd = prop_dictionary_internalize_from_file(vpkgfile);
|
vpkgd = prop_dictionary_internalize_from_file(vpkgfile);
|
||||||
free(vpkgfile);
|
free(vpkgfile);
|
||||||
|
|
||||||
if (vpkgd == NULL) {
|
if (vpkgd == NULL) {
|
||||||
xbps_dbg_printf("%s: failed to internalize %s: %s\n",
|
xbps_dbg_printf("[init_virtualpkgs] failed to "
|
||||||
__func__, dp->d_name, strerror(errno));
|
"internalize %s: %s\n",
|
||||||
|
dp->d_name, strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (prop_object_type(xh->virtualpkgs_array) == PROP_TYPE_UNKNOWN)
|
if (prop_object_type(xh->virtualpkgs_array) == PROP_TYPE_UNKNOWN)
|
||||||
xh->virtualpkgs_array = prop_array_create();
|
xh->virtualpkgs_array = prop_array_create();
|
||||||
|
|
||||||
if (!xbps_add_obj_to_array(xh->virtualpkgs_array, vpkgd)) {
|
if (!xbps_add_obj_to_array(xh->virtualpkgs_array, vpkgd)) {
|
||||||
xbps_dbg_printf("%s: failed to add %s virtualpkg "
|
xbps_dbg_printf("[init_virtualpkgs] failed to add %s "
|
||||||
"dictionary!\n", __func__, dp->d_name);
|
"virtuapkg dictionary!\n", dp->d_name);
|
||||||
prop_object_release(vpkgd);
|
prop_object_release(vpkgd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
xbps_dbg_printf("%s: added virtualpkg from: %s\n",
|
xbps_dbg_printf("[init_virtualpkgs] registered virtualpkg "
|
||||||
__func__, dp->d_name);
|
"'%s'\n", dp->d_name);
|
||||||
}
|
}
|
||||||
(void)closedir(dirp);
|
(void)closedir(dirp);
|
||||||
prop_object_release(vpkgdir);
|
prop_object_release(vpkgdir);
|
||||||
|
@ -83,7 +83,7 @@ xbps_regpkgdb_dictionary_init(struct xbps_handle *xhp)
|
|||||||
}
|
}
|
||||||
free(plist);
|
free(plist);
|
||||||
regpkgdb_initialized = true;
|
regpkgdb_initialized = true;
|
||||||
xbps_dbg_printf("%s: initialized ok.\n", __func__);
|
xbps_dbg_printf("[regpkgdb] initialized ok.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -99,5 +99,5 @@ xbps_regpkgdb_dictionary_release(void)
|
|||||||
xhp = xbps_handle_get();
|
xhp = xbps_handle_get();
|
||||||
prop_object_release(xhp->regpkgdb_dictionary);
|
prop_object_release(xhp->regpkgdb_dictionary);
|
||||||
regpkgdb_initialized = false;
|
regpkgdb_initialized = false;
|
||||||
xbps_dbg_printf("%s: released ok.\n", __func__);
|
xbps_dbg_printf("[regpkgdb] released ok.\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user