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

Andrew Gregory andrew.gregory.8 at gmail.com
Tue Jul 24 19:40:24 UTC 2018


On 07/24/18 at 02:48pm, Dave Reisner wrote:
> On Tue, Jul 24, 2018 at 05:53:00PM +0100, morganamilo wrote:
> > Commit 106d0fc54 Added the usage option for databases and
> > alpm_sync_newversion was restricted by USAGE_SEARCH instead of
> > USAGE_UPGRADE.
> 
> I don't recall exactly what my thinking was when I wrote this patch, but
> looking at 'pacman -Qu' output right now, I think I actually I like
> seeing potential upgrades, not just "actual" upgrades.
> 
> Anyone else have an opinion?

Based on how it's used, I'd say it should be SEARCH; it's being used
as a filter for -Q and no upgrade transaction is being performed, or
even prepared.

Really, though, I'd say this is a great example as to why usages
should have been implemented in the front-end or limited to only the
highest-level library functions.  Usage is contextual, how is libalpm
supposed to know how such a basic function is being used?  pacman may
only use it as a filter for -Q, but some other front-end could use it
to actually prepare an upgrade.


More information about the pacman-dev mailing list