[pacman-dev] [PATCH] pacman/query: print ignored for updates in databases without usage upgrade

Michael Straube michael.straube at posteo.de
Sun Dec 16 18:24:10 UTC 2018


Updates in databases that are not "Usage = Upgrade" will be ignored in a
-Su operation. Add [ignored] to the -Qu output for such updates.

Fixes FS#59854

Signed-off-by: Michael Straube <michael.straube at posteo.de>
---
 src/pacman/query.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/pacman/query.c b/src/pacman/query.c
index 00c39638..405dc61a 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -325,10 +325,12 @@ static int display(alpm_pkg_t *pkg)
 					colstr->version, alpm_pkg_get_version(pkg), colstr->nocolor);
 
 			if(config->op_q_upgrade) {
+				int usage;
 				alpm_pkg_t *newpkg = alpm_sync_newversion(pkg, alpm_get_syncdbs(config->handle));
 				printf(" -> %s%s%s", colstr->version, alpm_pkg_get_version(newpkg), colstr->nocolor);
 
-				if(alpm_pkg_should_ignore(config->handle, pkg)) {
+				alpm_db_get_usage(alpm_pkg_get_db(newpkg), &usage);
+				if(alpm_pkg_should_ignore(config->handle, pkg) || !(usage & ALPM_DB_USAGE_UPGRADE)) {
 					printf(" %s", _("[ignored]"));
 				}
 			}
-- 
2.20.0


More information about the pacman-dev mailing list