[pacman-dev] -Qu vs -Su

Roman Kyrylych roman.kyrylych at gmail.com
Sat Sep 29 06:17:30 EDT 2007


2007/9/28, Xavier <shiningxc at gmail.com>:
> Since the discussion on http://bugs.archlinux.org/task/7884 is confusing me,
> I thought I would bring it here.
>
> The issue reported by Dan is the following :
> The -Qu output is different than -Su one, because -Su resolves dependencies,
> while -Qu does not.
> My first question : is that really an issue?
>
> The description of -Qu says :
>   -u, --upgrades       list all packages that can be upgraded
>
> IMO, a new dependency does not belong to the list of packages that can be
> upgraded. So it isn't necessarily a bug if it shows up in -Su, but not in
> -Qu.
>
>
> Also, note that -Qu can't match exactly -Su, because -Su is interactive :
> Replace %s with %s/%s? [Y/n]
> %s conflicts with %s. Remove %s? [Y/n]
>
> But if you answer no to the conflicts question, pacman just fails and stops
> there. So not very interesting.
> And the replace question is generally answered by yes.
> So answering yes to both questions should give a good picture of what will
> happen.
>

I also quote Aaron's comment from Flyspray:
> I want one function that says "give me a list of packages that are upgradable". This function can be used in -Qu (simply returning the list and printing), -Su (using the list as targets), and -Sup (returning the list and calling some public alpm_pkg_get_url() on each member).
>
> A public accessor to get a URL for a package can make -Qu and -Sup almost the same, except with different output functions.


I uderstand "a list of packages that are upgradeable" as a list of
_already_installed_ packages that have newer versions available or
there are new packages that replace them.
This is different from the list that -Su and -Sup gives, because they
list packages that are _going_to_be_installed_, including new
dependencies.
And this is also different from -Qu.
The description of -Qu says "list all packages that can be upgraded"
But -Qu doesn't do this! It displays _new_versions_(and replacements)_
of currently installed packages. This is different.

So I propose the function list_upgradeable_packages() to list those
installed packages that are not in IgnorePkg and has either new
version, replacement or older version with options=(force) available
in repos.
Then -Qu, -Su and -Sup should do the following with the result of that function:
-Qu - just print the result
-Su - use the result as a list of packages that are going to be upgraded
(exactly the same as -S pkg1 pkg2 ... pkgN)
-Sup - same as -Su just print URIs

-- 
Roman Kyrylych (Роман Кирилич)


More information about the pacman-dev mailing list