[pacman-dev] [PATCH] during -Qu add [ignored] for repos without Usage = Upgrade

2018-08-31 Thread morganamilo
Fixes FS#59854

Signed-off-by: morganamilo 
---
 src/pacman/query.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/pacman/query.c b/src/pacman/query.c
index 00c39638..faa06e60 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -325,10 +325,14 @@ 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));
+   alpm_db_t *db = alpm_pkg_get_db(newpkg);
+   alpm_db_get_usage(db, );
+
printf(" -> %s%s%s", colstr->version, 
alpm_pkg_get_version(newpkg), colstr->nocolor);
 
-   if(alpm_pkg_should_ignore(config->handle, pkg)) 
{
+   if(alpm_pkg_should_ignore(config->handle, pkg) 
|| !(usage & ALPM_DB_USAGE_UPGRADE)) {
printf(" %s", _("[ignored]"));
}
}
-- 
2.18.0


Re: [pacman-dev] [PATCH] libalpm/sync.c: restrict alpm_sync_newversion by USAGE_UPGRADE

2018-08-31 Thread Morgan Adamiec
On Wed, 29 Aug 2018 at 06:03, Allan McRae  wrote:
> Someone should send the pacman-contrib maintainers a patch to use that
> instead of -Qu.

Sadly you would need some sort of 'currentpkgver' formatter
`--print-format "%n %currentpkgver -> %v"`.