summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-05-20 13:10:32 +0200
committerAllan McRae <allan@archlinux.org>2015-06-20 17:32:57 +1000
commita187fa4562dc2f43f10134092056c2a9a6862d59 (patch)
treefe213ff5f6c42e2c6e569ca14772167a1bf24f23
parent4b0bc2cf9724e3c9592c045349a38b426148e3b2 (diff)
downloadpacman-a187fa4562dc2f43f10134092056c2a9a6862d59.tar.xz
Match providers when showing optdep install status
Use alpm_find_satisfier() instead of alpm_db_get_pkg() when retrieving the install status of a package to make sure we spot providers as well. Fixes FS#36412 Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/pacman/package.c3
-rw-r--r--src/pacman/util.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 33184bd5..2fd0a9c3 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -57,11 +57,12 @@ static void deplist_display(const char *title,
static void optdeplist_display(alpm_pkg_t *pkg, unsigned short cols)
{
alpm_list_t *i, *text = NULL;
+ alpm_db_t *localdb = alpm_get_localdb(config->handle);
for(i = alpm_pkg_get_optdepends(pkg); i; i = alpm_list_next(i)) {
alpm_depend_t *optdep = i->data;
char *depstring = alpm_dep_compute_string(optdep);
if(alpm_pkg_get_origin(pkg) == ALPM_PKG_FROM_LOCALDB) {
- if(alpm_db_get_pkg(alpm_get_localdb(config->handle), optdep->name)) {
+ if(alpm_find_satisfier(alpm_db_get_pkgcache(localdb), optdep->name)) {
const char *installed = _(" [installed]");
depstring = realloc(depstring, strlen(depstring) + strlen(installed) + 1);
strcpy(depstring + strlen(depstring), installed);
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 7c6a8c0d..9fdc39a5 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1204,9 +1204,10 @@ static int depend_cmp(const void *d1, const void *d2)
static char *make_optstring(alpm_depend_t *optdep)
{
+ alpm_db_t *localdb = alpm_get_localdb(config->handle);
char *optstring = alpm_dep_compute_string(optdep);
char *status = NULL;
- if(alpm_db_get_pkg(alpm_get_localdb(config->handle), optdep->name)) {
+ if(alpm_find_satisfier(alpm_db_get_pkgcache(localdb), optdep->name)) {
status = _(" [installed]");
} else if(alpm_pkg_find(alpm_trans_get_add(config->handle), optdep->name)) {
status = _(" [pending]");