diff --git a/include/xbps_api.h b/include/xbps_api.h index 9c9c86d1..05df0b8d 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -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" /** diff --git a/lib/plist_find.c b/lib/plist_find.c index ccf4fd3b..094f79ad 100644 --- a/lib/plist_find.c +++ b/lib/plist_find.c @@ -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;