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

Allan McRae allan at archlinux.org
Wed Sep 19 09:00:09 UTC 2018

On 1/9/18 9:35 am, morganamilo wrote:
> Fixes FS#59854
> Signed-off-by: morganamilo <morganamilo at gmail.com>
> ---

You patch is fine...  But in testing it, I once again come to see how
screwy -Qu is!  We need to go back to your original issue.

-Qu ignores databases with Usage = Sync or Install when calculating the
list of possible package updates, but not databases with Usage = Search.

It gets better...   packages in databases with Usage = Upgrade do not
show up in -Qu.  That is clearly wrong!

What is special about Usage = Search?  I can't see why these packages
should be included in a -Qu output and not those from a database with
Usage = Sync/Install/Upgrade.

Lets look at the relevant function:

/** Check for new version of pkg in sync repos
 * (only the first occurrence is considered in sync)
alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t

We need to define the sync repos that are searched.  We either look at
all sync repos, or those with Usage = Upgrade/All.  I can't see a
justification for anything else.

Going to "man pacman" for -Qu

-u, --upgrades
   Restrict or filter output to packages that are out-of-date on the
   local system. Only package versions are used to find outdated
   packages; replacements are not checked here. This option works best
   if the sync database is refreshed using -Sy.

The option name implies we should only print those with Usage =
Upgrade/All, but the description suggests we can print all of them.  I'm
inclined to go with the option name, as that is less mutable than the

My plan is to change alpm_sync_newversion to take an additional
parameter to flag whether it should include all databases or just those
available for upgrades.  It could even be make more flexible and just
take the bitmask as a parameter for filtering.


More information about the pacman-dev mailing list