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

Morgan Adamiec morganamilo at gmail.com
Tue Jul 24 19:31:55 UTC 2018


On Tue, 24 Jul 2018 at 20:24, Erich Eckner <arch at eckner.net> wrote:
>
> On 24.07.2018 20:48, 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?
>
> Frankly, I don't really understand what would change - what does "the
> database Has the Upgrade option" mean? What is the difference between an
> "actual" and a "potential" upgrade?
>
> Please exuse if these are stupid questions - I'm just a user of "-Qu".
>
> regards,
> Erich
>
> >
> >> USAGE_UPGRADE should be used instead. This means packages only show up
> >> in commands such as `pacman -Qu` if the database Has the Upgrade option.
> >>
> >> Signed-off-by: morganamilo <morganamilo at gmail.com>
> >>
> >> diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
> >> index 696a5131..23b0ccfa 100644
> >> --- a/lib/libalpm/sync.c
> >> +++ b/lib/libalpm/sync.c
> >> @@ -61,7 +61,7 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn
> >>
> >>      for(i = dbs_sync; !spkg && i; i = i->next) {
> >>              alpm_db_t *db = i->data;
> >> -            if(!(db->usage & ALPM_DB_USAGE_SEARCH)) {
> >> +            if(!(db->usage & ALPM_DB_USAGE_UPGRADE)) {
> >>                      continue;
> >>              }
> >>
> >> --
> >> 2.18.0
>

See the Usage option in pacman.conf (5)

Personally I would like -Qu to show actual upgrades. Mainly for the
checkupdates script. Which many people use create update notifiers.
It's quite annoying to have a notification always saying there's an
update available when in reality it's just a package in a database
that you only have Usage = Sync Search.

On a lower level I would also like to use alpm_sync_newversion so get
pending upgrades. The alternative right now Is starting a transaction
and calling alpm_sync_sysupgrade.


More information about the pacman-dev mailing list