From 92c7d9932e48d9db49b7ea053fe97a3c7a69e42c Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Tue, 18 Aug 2009 16:56:19 +0200 Subject: [PATCH] query.c : return 1 when no package match For example, if no package is outdated, -Qu will return 1. This implements FS#15938 Signed-off-by: Xavier Chantry --- src/pacman/query.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/pacman/query.c b/src/pacman/query.c index 32752ff..0c91522 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -394,6 +394,7 @@ static int display(pmpkg_t *pkg) int pacman_query(alpm_list_t *targets) { int ret = 0; + int match = 0; alpm_list_t *i; pmpkg_t *pkg = NULL; @@ -436,8 +437,12 @@ int pacman_query(alpm_list_t *targets) if(value != 0) { ret = 1; } + match = 1; } } + if(!match) { + ret = 1; + } return(ret); } @@ -471,6 +476,7 @@ int pacman_query(alpm_list_t *targets) if(value != 0) { ret = 1; } + match = 1; } if(config->op_q_isfile) { @@ -479,6 +485,10 @@ int pacman_query(alpm_list_t *targets) } } + if(!match) { + ret = 1; + } + return(ret); } -- 1.6.1.2