libxbps: new function xbps_pkgdb_get_pkgd_by_pkgver().

Finds a pkg dictionary in pkgdb by matching its pkgver object.
This commit is contained in:
Juan RP
2012-04-05 10:57:15 +02:00
parent feacc506de
commit 732ce45b86
2 changed files with 30 additions and 2 deletions

View File

@@ -189,6 +189,22 @@ xbps_pkgdb_get_pkgd(const char *pkg, bool bypattern)
return NULL;
}
prop_dictionary_t
xbps_pkgdb_get_pkgd_by_pkgver(const char *pkgver)
{
struct xbps_handle *xhp = xbps_handle_get();
prop_dictionary_t pkgd = NULL;
if (xbps_pkgdb_init(xhp) != 0)
return NULL;
pkgd = xbps_find_pkg_in_array_by_pkgver(xhp->pkgdb, pkgver);
if (pkgd != NULL)
return prop_dictionary_copy(pkgd);
return NULL;
}
bool
xbps_pkgdb_remove_pkgd(const char *pkg, bool bypattern, bool flush)
{