We want searching to be super-quick after a cache refresh, and we don't want to
wait the ~10 seconds while hawkey is rebuilding the SAT database for ~5 repos.
This also allows us to have a pre-generated cache on the LiveCD if we're using
packagekit-direct refresh.
If we have a sack of:
INSTALLED myawesomepackage-1.0
AVAILABLE myawesomepackage-1.0
AVAILABLE myawesomepackage-1.1
AVAILABLE myawesomepackage-1.2
... include latest packages in the INSTALLED state and latest packages
in the AVAILABLE state in the NEWEST filter results, so that we return:
INSTALLED myawesomepackage-1.0
AVAILABLE myawesomepackage-1.2
This matches the previous yum backend behaviour and simplifies code on
the gnome-software side.
https://bugzilla.redhat.com/show_bug.cgi?id=1113935
We had existing code that allowed us to keep multiple kernel packages
installed, but this had broken at some point. This commit reimplements it using
current hawkey API, simplifying code and making it work again.
Signed-off-by: Richard Hughes <richard@hughsie.com>