libxbps: cache regpkgdb just when it's needed not via xbps_init().

This commit is contained in:
Juan RP
2011-12-22 12:56:56 +01:00
parent 8fd5253e31
commit b232ca1815
6 changed files with 29 additions and 16 deletions

View File

@ -182,6 +182,11 @@ xbps_find_pkg_orphans(prop_array_t orphans_user)
* in which packages were installed.
*/
od.orphans_user = orphans_user;
if ((rv = xbps_regpkgdb_dictionary_init(xhp)) != 0) {
xbps_dbg_printf("%s: couldn't initialize "
"regpkgdb: %s\n", strerror(rv));
return NULL;
}
rv = xbps_callback_array_iter_reverse_in_dict(xhp->regpkgdb_dictionary,
"packages", find_orphan_pkg, &od);
if (rv != 0) {