Skip to content

Set 'NEWEST' flag when resolving packages with PackageKit

Adam Williamson requested to merge AdamW/realmd:packagekit-latest into master

When resolving package names via PackageKit, realmd does not set the PK_FILTER_ENUM_NEWEST flag that asks PK to only give the newest available package for each package name. So if there are three different versions of the package available in three repositories, realmd winds up producing an array containing the package IDs for all three of those packages and calling InstallPackages on all of them. I don't know if PK's behaviour in this case is defined or predictable, but in practice in at least one case it reliably results in one of the older package versions being installed.

This does not seem desirable, we should always want to install the newest available version. So let's set the NEWEST flag to ensure this.

A possible consequence here is that, if a newer version of the package is not installable but an older version is, we will now fail where previously we did not. But even in that case I don't know if we would reliably succeed before, and silently installing an older version still doesn't necessarily seem like the right thing to do.

Signed-off-by: Adam Williamson awilliam@redhat.com

Merge request reports