Update row missing installed versions ( from_version )
Sometimes installed version ( from_version
) is not listed in the Updates page. Refer below screenshot:
This are 2 issues here:
Issue 1:
We set the version from the first entry returned by PackageKit in the packages
array, which can be either the Installed
or the Available
version. So, some entries have from_version
-> to_version
in Updates page, while others have just to_version
, as from_version
is the same as to_version
( when Available
package is listed before Installed
in packages
array ).
void
gs_plugin_packagekit_resolve_packages_app (GsPlugin *plugin,
GPtrArray *packages,
GsApp *app)
{
for (j = 0; j < sources->len; j++) {
pkgname = g_ptr_array_index (sources, j);
for (i = 0; i < packages->len; i++) {
package = g_ptr_array_index (packages, i);
if (g_strcmp0 (pk_package_get_name (package), pkgname) == 0) {
gs_plugin_packagekit_set_metadata_from_package (plugin, app, package);
}
...
...
}
}
...
...
}
Possible fix:
Below patch fixes this issue, though it might not be 100% correct.
--- a/plugins/packagekit/packagekit-common.c
+++ b/plugins/packagekit/packagekit-common.c
@@ -338,9 +338,9 @@ gs_plugin_packagekit_resolve_packages_app (GsPlugin *plugin,
for (i = 0; i < packages->len; i++) {
package = g_ptr_array_index (packages, i);
if (g_strcmp0 (pk_package_get_name (package), pkgname) == 0) {
- gs_plugin_packagekit_set_metadata_from_package (plugin, app, package);
switch (pk_package_get_info (package)) {
case PK_INFO_ENUM_INSTALLED:
+ gs_plugin_packagekit_set_metadata_from_package (plugin, app, package);
number_installed++;
break;
case PK_INFO_ENUM_AVAILABLE: