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

Andrew Gregory andrew.gregory.8 at gmail.com
Wed Jul 25 01:28:49 UTC 2018

On 07/25/18 at 02:23am, Morgan Adamiec wrote:
> On Tue, 24 Jul 2018 at 20:40, Andrew Gregory <andrew.gregory.8 at gmail.com> wrote:
> > 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.
> The thing is pacman with not let you use -s with -u: error: invalid
> option: '--search' and '--upgrade' may not be used together. By that
> logic you could argue it is not a search at all.
> Front ends aside the function is called alpm_sync_newversion, it makes
> no mention to searching.

It makes no mention of upgrading either.

> Slightly off topic of the original patch. Playing around more I've
> come to find that Upgrade implies Install. Is that an oversight or is
> it intended?
> As for use case I would like tp pacman -S db/pkg explicitly and have
> them upgrade but never touch the repo during a normal pacman -S pkg.

How is that different from just putting that repo below the one you
want it to use normally?

More information about the pacman-dev mailing list