[zypp-devel] Some needed (zypp) solver API additions
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! I've put together the following list of things that would be nice to have in libzypp API. These are needed by command line apps like zypper or ruby/python scripts using the bindings, since they typically do not select packages to install by pointing at one particular package from a list of available (GUI/TUI way), but rather by package name or capability plus some preferences like repo, arch, version. Also, because of this, a command line app either needs a feedback from solver about the requested operation, or it needs to get a clue whether the operation will succeed in advance. Example: either: request to install package with given name, solve, get feedback from solver that the package is already installed, tell the user or: check whether the best package is already installed (no update candidate is available), and either tell the user it already is, or tell the solver to install it. More complex example would be bnc #482307: there is a higher version of a package available, but in repo with lower priority. In GUI, if you wondered why it does not upgrade a package, you could check the Versions tab, and you could click to choose the version. In CLI, e.g. when you do 'zypper up foo' it should tell you "no update candidate for foo found" plus a hint "foo x.y.z is available in repository 'bar' which has priority X. Use 'zypper in foo-x.y.z' or whatever to install that package.". The following could help. The list: (notes below) - --------- a) install package with given name (1), plus optionaly: - enforce specific version (2) - enforce specific repo (2) - enforce specific arch (3) - force the operation: if appropriate package is already installed, reinstall it, considering given version/repo/arch preferences (meaning even if specified version is already installed, reinstall; evein if better version that the specified is installed, downgrade; etc - we should before make a list of all cases before implementing). b) install pacakge with given capability, plus optionaly: - enforce specific version (we have this) - enforce specific repo - enforce specific arch (4) - force the operation (like above) c) update package with given name (7), plus optionaly: - enforce specific repo - adjust update policy (vendor change, arch change, etc.) d) find the best package with given name (5) - plus the options available in a)? e) find update candidate for given installed package having the same arch, plus optionally: - having any compatible arch - from specified repo - regardless of priorities - regardless of vendor - maybe other policies f) Install srcpackage _without_ build deps (6) - with specified version - from specified repo g) Remove a package by name (8) - plus enforce specific version (for multiversion packages) h) Remove a pattern - needs to be defined - could be something like remove all packages required[/recommended/suggested] by the pattern. If a), b), c), f), g) are provided, d) and e) are needed as the hint, to give the user feedback. Anything else? If you agree to have these in libzypp, i'd like to help implementing them, of course, since this is quite a lot of work but it would move the burden from zypper to libzypp. But more than that, it would allow to add these to libzypp testsuite, and it would make the functionality available to ruby/python via bindings. Notes: (1) Currently zypper chooses the best package by itself and does ResStatus::setToBeInstalled(zypp::ResStatus::USER). It could use The new solver API (SolverQueueItemInstall + resolveQueue(), but that currently lacks the other capabilities - forcing arch/version/repo, and one has to be carefull not to mix resolvePool() and resolveQueue()). (2) Currently zypper needs to do this by itself (3) Currently zypper would need to do this by itself (not implemented) (4) Currently zypper appends .arch to the capability name to do this (5) Something like Selectable::candidate(), but that's rather GUI/TUI specific. We need also a method that would return the best no matter what is already "transacting" or installed. (6) Currently it automatically drags the build deps in, apps need to use ZYpp::installSrcPackage(srcpkg) (7) Similarly like in (1), SolverQueueItemUpdate could be enhanced? (8) SolverQueueItemRemove seems to do this, but does not allow to choose name/capability, and version. BTW: do we have a list of solver policies somewhere (else than the satsolver source code :O) and a list of possible ways to change them? - -- cheers, jano Ján Kupec YaST team - ---------------------------------------------------------(PGP)--- Key ID: 637EE901 Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901 - ---------------------------------------------------------(IRC)--- Server: irc.freenode.net Nick: jniq Channels: #zypp #yast #suse #susecz - ---------------------------------------------------------(EOF)--- -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkm3p9UACgkQgEhGpmN+6QG0igCeL8AdKBNBUTDBhxCKzG/CHJsV ADoAn2dra8hKgEV/ZNCNux/MLiLgyvfo =JrwM -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 11 March 2009 13:00:21 Jan Kupec wrote:
Hi!
I've put together the following list of things that would be nice to have in libzypp API. These are needed by command line apps like zypper or ruby/python scripts using the bindings, since they typically do not select packages to install by pointing at one particular package from a list of available (GUI/TUI way), but rather by package name or capability plus some preferences like repo, arch, version.
Thanks for your list. It perfectly describes what one likes to see in an easy to use api. The 'new' solver api you mentioned should not be announced too loud, because the goal is to unify resolvePool() and resolveQueue(). I'd like to move towards one interface that fits CLI and UI. This will allow to provide most of the operatinos within the Selecatble api.
f) Install srcpackage _without_ build deps (6)
I see if we can add a solver option for this. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Andres
The 'new' solver api you mentioned should not be announced too loud, because the goal is to unify resolvePool() and resolveQueue(). I'd like to move towards one interface that fits CLI and UI. This will allow to provide most of the operatinos within the Selecatble api.
I wonder if 'Selectable', originating from the needs of the Qt UI, is the right class to deal with in a generic API. Going forward, I'd like libzypp to offer four (distinct?) APIs: - repository management This would cover add, edit, remove repositories including key handling, as well as 'refresh' and .solv creation. - information management All 'search' type operations as well as solvable attribute handling. - dependency solving This would cover all solver operations, esp. creating a transaction (install, update, remove of packages), 'distribution update', dependency solving and problem/solution handling. - commit Starting with a successfully solved transaction, this would cover all package download, package cache, pre-req ordering and the actual RPM operations. The named areas also hint on the granularity of locking in our attempt to remove the 'big' zypp lock. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thursday 12 March 2009 10:08:36 Klaus Kaempf wrote:
* Michael Andres
[Mar 11. 2009 17:51]: The 'new' solver api you mentioned should not be announced too loud, because the goal is to unify resolvePool() and resolveQueue(). I'd like to move towards one interface that fits CLI and UI. This will allow to provide most of the operatinos within the Selecatble api.
I wonder if 'Selectable', originating from the needs of the Qt UI, is the right class to deal with in a generic API.
Well, it's not the verry same Selectable. But if you look at Jano's list, there are 2 major keys: byName and byCapability. An then some minor ones like arch, version, repo. The current UI-Selectable groups packages by name. You have easy access to all packages with the same name. You see the installed and available ones. You can file solver request, and you can inspect the results. Extend Selectable to give easy access to all packages providing a specific capability. And to manage the Capability based request. Selectable is (will have to be) a filter byName/Capability and some convenience to inspect the result, and manage the solver request. And it's the place to build request not (yet) directly covered by the solver, like 'install package foo with vendor baa'. The Selctable will translate this into a 'install one out of many' request. Or say you want to install a specific source package with or without solving its builddeps. Of course one can manually create and file a solver request to install 'capability libfoo', solve, and then search through the result queue to see which specific package is also a provider of libfoo.
Going forward, I'd like libzypp to offer four (distinct?) APIs:
- repository management This would cover add, edit, remove repositories including key handling, as well as 'refresh' and .solv creation.
- information management All 'search' type operations as well as solvable attribute handling.
- dependency solving This would cover all solver operations, esp. creating a transaction (install, update, remove of packages), 'distribution update', dependency solving and problem/solution handling.
- commit Starting with a successfully solved transaction, this would cover all package download, package cache, pre-req ordering and the actual RPM operations.
The named areas also hint on the granularity of locking in our attempt to remove the 'big' zypp lock.
yes. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jan Kupec wrote:
Hi!
I've put together the following list of things that would be nice to have in libzypp API. These are needed by command line apps like zypper or ruby/python scripts using the bindings, since they typically do not select packages to install by pointing at one particular package from a list of available (GUI/TUI way), but rather by package name or capability plus some preferences like repo, arch, version.
Also, because of this, a command line app either needs a feedback from solver about the requested operation, or it needs to get a clue whether the operation will succeed in advance.
Example: either: request to install package with given name, solve, get feedback from solver that the package is already installed, tell the user or: check whether the best package is already installed (no update candidate is available), and either tell the user it already is, or tell the solver to install it.
More complex example would be bnc #482307: there is a higher version of a package available, but in repo with lower priority. In GUI, if you wondered why it does not upgrade a package, you could check the Versions tab, and you could click to choose the version. In CLI, e.g. when you do 'zypper up foo' it should tell you "no update candidate for foo found" plus a hint "foo x.y.z is available in repository 'bar' which has priority X. Use 'zypper in foo-x.y.z' or whatever to install that package.". The following could help.
The list: (notes below) ---------
a) install package with given name (1), plus optionaly: - enforce specific version (2) - enforce specific repo (2) - enforce specific arch (3) - force the operation: if appropriate package is already installed, reinstall it, considering given version/repo/arch preferences (meaning even if specified version is already installed, reinstall; evein if better version that the specified is installed, downgrade; etc - we should before make a list of all cases before implementing).
b) install pacakge with given capability, plus optionaly: - enforce specific version (we have this) - enforce specific repo - enforce specific arch (4) - force the operation (like above)
c) update package with given name (7), plus optionaly: - enforce specific repo - adjust update policy (vendor change, arch change, etc.)
d) find the best package with given name (5) - plus the options available in a)?
e) find update candidate for given installed package having the same arch, plus optionally: - having any compatible arch - from specified repo - regardless of priorities - regardless of vendor - maybe other policies
f) Install srcpackage _without_ build deps (6) - with specified version - from specified repo
g) Remove a package by name (8) - plus enforce specific version (for multiversion packages)
h) Remove a pattern - needs to be defined - could be something like remove all packages required[/recommended/suggested] by the pattern.
i) Install a pattern - with recommended packages (default) - with suggested packages - in case the pattern is already satisfied, select not yet installed packages recommended/suggested by the pattern for installation This could be used by both CLIs and GUIs (bnc #432562 + probably bnc #476965). j.
If a), b), c), f), g) are provided, d) and e) are needed as the hint, to give the user feedback.
Anything else? If you agree to have these in libzypp, i'd like to help implementing them, of course, since this is quite a lot of work but it would move the burden from zypper to libzypp. But more than that, it would allow to add these to libzypp testsuite, and it would make the functionality available to ruby/python via bindings.
Notes: (1) Currently zypper chooses the best package by itself and does ResStatus::setToBeInstalled(zypp::ResStatus::USER). It could use The new solver API (SolverQueueItemInstall + resolveQueue(), but that currently lacks the other capabilities - forcing arch/version/repo, and one has to be carefull not to mix resolvePool() and resolveQueue()). (2) Currently zypper needs to do this by itself (3) Currently zypper would need to do this by itself (not implemented) (4) Currently zypper appends .arch to the capability name to do this (5) Something like Selectable::candidate(), but that's rather GUI/TUI specific. We need also a method that would return the best no matter what is already "transacting" or installed. (6) Currently it automatically drags the build deps in, apps need to use ZYpp::installSrcPackage(srcpkg) (7) Similarly like in (1), SolverQueueItemUpdate could be enhanced? (8) SolverQueueItemRemove seems to do this, but does not allow to choose name/capability, and version.
BTW: do we have a list of solver policies somewhere (else than the satsolver source code :O) and a list of possible ways to change them?
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkm/43kACgkQgEhGpmN+6QFRXwCeO4XapWhi+6HDaZheGSJ76WlZ xLYAnA5PKh6V6jH2hcA6hJkXWhdeBFjS =cpdd -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Jan Kupec
i) Install a pattern - with recommended packages (default) - with suggested packages
This doesn't really match the intention of 'suggested' which is defined as Suggests are just hints for an application and not handled during dependency resolution. Think of 'Amazons Customers who bought this item also bought' in http://en.opensuse.org/Software_Management/Dependencies And I haven't seen a "Put all stuff other customers bought into your Cart" at Amazon ;-) Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Klaus Kaempf wrote:
* Jan Kupec
[Mar 17. 2009 19:03]: i) Install a pattern - with recommended packages (default) - with suggested packages
This doesn't really match the intention of 'suggested' which is defined as
Suggests are just hints for an application and not handled during dependency resolution. Think of 'Amazons Customers who bought this item also bought'
in http://en.opensuse.org/Software_Management/Dependencies
And I haven't seen a "Put all stuff other customers bought into your Cart" at Amazon ;-)
OK, so feature like a context menu item "Select all packages suggested by the pattern" in the YaST packager, or 'zypper in -t pattern - --with-suggested' is useless? j. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAknAuqkACgkQgEhGpmN+6QHa1ACggw1pR4PmM7bbG85cj372U2UY 6b0An1ESFHJXn4HiRLMcJPYNkTqVIkYu =Q9Po -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Jan Kupec
And I haven't seen a "Put all stuff other customers bought into your Cart" at Amazon ;-)
OK, so feature like a context menu item "Select all packages suggested by the pattern" in the YaST packager, or 'zypper in -t pattern - --with-suggested' is useless?
Yes. It should be a view (resp. filter) option, like "show packages related (suggested by) this package". Then the user can select some of them for install. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tue, Mar 17, 2009 at 06:52:57PM +0100, Jan Kupec wrote:
[...] - in case the pattern is already satisfied, select not yet installed packages recommended/suggested by the pattern for installation
I believe the solver already does this. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (4)
-
Jan Kupec
-
Klaus Kaempf
-
Michael Andres
-
Michael Schroeder