2007/9/28, Xavier <shiningxc@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 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
I also quote Aaron's comment from Flyspray: 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 My opinion: The description of -Qu should say : -u, --upgrades list outdated packages and other switches should be able to used with -Qu, such as -i etc. etc.
User can use -Su if he want to see the to-be-installed packages, then answer no to the "proceed question". A bit off in this thread, but the current command-line handling of pacman is chaotic, for example the bahaviour of -Quil is not defined. We should restructure a bit, we should categorize options: (my example assumes -S) -operation: -l, -i, -c, -l, -p, -s, -y ... <- more than one allowed (pacman try to do all requested operations) -loadtarget/targettype-modifier options, -g, (--provider), -u (!!) ... <- only one allowed -trans_prepare/new-target-pull options: -d, (--noconflict option), -e ... <- more than one allowed -trans_commit options: -f, --asdeps, -w (do nothing) ... <- more than one allowed As an example, I explain what should pacman -Quetcl do: List all explicitly installed outdated not-a-dependency-of-other packages and show their changlogs and filelists ;-) Bye, ngaba ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/