libxbps: make the xbps_find_*pkg_dict_installed work as expected.

Bump XBPS_API_VERSION due to semantics change in virtual and non virtual
functions.
This commit is contained in:
Juan RP 2011-10-16 17:21:43 +02:00
parent d70036dd81
commit b6da7393c1
2 changed files with 14 additions and 5 deletions

View File

@ -55,7 +55,7 @@
*/
#define XBPS_PKGINDEX_VERSION "1.2"
#define XBPS_API_VERSION "20111016"
#define XBPS_API_VERSION "20111016-1"
#define XBPS_VERSION "0.10.0"
/**

View File

@ -341,12 +341,21 @@ find_pkgd_installed(const char *str, bool bypattern, bool virtual)
if (xhp->regpkgdb_dictionary == NULL)
return NULL;
pkgd = find_virtualpkg_user_in_dict(xhp->regpkgdb_dictionary,
"packages", str, bypattern);
if (pkgd == NULL) {
/* try normal pkg */
if (virtual == false) {
pkgd = find_pkg_in_dict(xhp->regpkgdb_dictionary,
"packages", str, bypattern, virtual);
"packages", str, bypattern, false);
} else {
/* virtual pkg set by user in conf */
pkgd = find_virtualpkg_user_in_dict(xhp->regpkgdb_dictionary,
"packages", str, bypattern);
if (pkgd == NULL) {
/* any virtual pkg in dictionary matching pattern */
pkgd = find_pkg_in_dict(xhp->regpkgdb_dictionary,
"packages", str, bypattern, true);
}
}
/* pkg not found */
if (pkgd == NULL)
return NULL;