From c5d6ccde46acf329fcd7a5a6431f877fa9c74446 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 30 Oct 2011 16:24:56 +0100 Subject: [PATCH] libxbps: make check_is_installed_pkg_* use only find_virtualpkg_dict_installed. xbps_find_virtualpkg_dict_installed() also finds real packages, so there's no need to use both in xbps_check_is_installed_pkg_by_{name,pattern}. Bump XBPS_API_VERSION. --- include/xbps_api.h | 2 +- lib/util.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/xbps_api.h b/include/xbps_api.h index d41055c9..7a33f8f1 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 "20111030-1" +#define XBPS_API_VERSION "20111030-2" #define XBPS_VERSION "0.11.0" /** diff --git a/lib/util.c b/lib/util.c index 86c0ccaa..dfa8329d 100644 --- a/lib/util.c +++ b/lib/util.c @@ -65,8 +65,7 @@ xbps_check_is_installed_pkg_by_pattern(const char *pattern) assert(pattern != NULL); - if ((dict = xbps_find_pkg_dict_installed(pattern, true)) == NULL) - dict = xbps_find_virtualpkg_dict_installed(pattern, true); + dict = xbps_find_virtualpkg_dict_installed(pattern, true); if (dict == NULL) { if (errno == ENOENT) { errno = 0; @@ -98,10 +97,7 @@ xbps_check_is_installed_pkg_by_name(const char *pkgname) assert(pkgname != NULL); - pkgd = xbps_find_pkg_dict_installed(pkgname, false); - if (pkgd == NULL) - pkgd = xbps_find_virtualpkg_dict_installed(pkgname, false); - + pkgd = xbps_find_virtualpkg_dict_installed(pkgname, false); if (pkgd) { prop_object_release(pkgd); return true;