[packagekit] Resolve method

Richard Hughes hughsient at gmail.com
Tue Oct 2 09:13:32 PDT 2007


On Tue, 2007-10-02 at 12:27 +0200, Tim Lauridsen wrote:
> I have added resolve to the python common backend and implented it in 
> the yum backend.
> I am not sure if it works the right way ??
> 'resolve foo' will return
> all installed packages with the name 'foo' (there kan be more than one, 
> in some cases ex. 'kernel')
> the available package with the name 'foo' and an EVR > all installed 
> packages ( EVR = epoch:version-release)
> 
> Ex. (installed:  'foo-1.0-3', in repo 'foo-1.0-1', 'foo-1.0-2', 'foo-1.0-3')
> 'resolve foo' will return
> package installed    foo;1.0-3;i386;updates  the foo packages
> 
> Ex. (installed:  'foo-1.0-2, in repo 'foo-1.0-1', 'foo-1.0-2', 'foo-1.0-3')
> 'resolve foo' will return
> package installed    foo;1.0-2;i386;updates  the foo packages
> package available    foo;1.0-3;i386;updates  the foo packages
> 
> Ex. (in repo 'foo-1.0-1', 'foo-1.0-2', 'foo-1.0-3')
> 'resolve foo' will return
> package available    foo;1.0-3;i386;updates  the foo packages

Yes, hmm, good questions. I must admit, the nuances of this escaped me
late last night.

The whole idea for resolve is for the user to eventually type "pkcon
install openoffice-clipart" or for the openoffice program to request
that "openoffice-clipart" is to be installed without knowing the
package_id. It can also be used to see if a package has been installed
without searching for files or doing other hacks.

With this in mind I think we can say that:

* Resolve will always return a Package of the installed version (if
installed)
* Resolve will also return as "available" a single Package if
installable or upgradeable. This should be the highest version number of
all the available candidates.

So in theory doing Resolve for kernel (when no updates are available)
would give emit one Package entry with the highest installed version,
even if multiple packages are installed. Doing it when there is an
update waiting to be applied would give a Package of the "best"
installed version, and a Package of the "best" available option.

So, this would give exactly the output you have done in your examples;
it allows us to check if a package is installed, if it has updates, or
if it's available in the repo.

Is that clearer? Thanks.

Richard.




More information about the PackageKit mailing list