Commit 4a3c21bd authored by Kalev Lember's avatar Kalev Lember

packagekit: trivial: Don't save the cache age when calling get_updates

There's little point in doing that because we only have two entry points
here, and the other one (refresh) always sets the cache age explicitly.

Also update some comments while at this.
parent 4e3dd2e9
Pipeline #37427 passed with stage
in 9 minutes and 6 seconds
......@@ -62,30 +62,30 @@ _download_only (GsPlugin *plugin, GsAppList *list,
GCancellable *cancellable, GError **error)
GsPluginData *priv = gs_plugin_get_data (plugin);
guint cache_age_save;
g_auto(GStrv) package_ids = NULL;
g_autoptr(GsPackagekitHelper) helper = gs_packagekit_helper_new (plugin);
g_autoptr(PkPackageSack) sack = NULL;
g_autoptr(PkResults) results2 = NULL;
g_autoptr(PkResults) results = NULL;
/* refresh the metadata */
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
cache_age_save = pk_client_get_cache_age (PK_CLIENT (priv->task));
/* never refresh the metadata here as this can surprise the frontend if
* we end up downloading a different set of packages than what was
* shown to the user */
pk_client_set_cache_age (PK_CLIENT (priv->task), G_MAXUINT);
/* get the list of packages to update */
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
results = pk_client_get_updates (PK_CLIENT (priv->task),
pk_bitfield_value (PK_FILTER_ENUM_NONE),
gs_packagekit_helper_cb, helper,
pk_client_set_cache_age (PK_CLIENT (priv->task), cache_age_save);
if (!gs_plugin_packagekit_results_valid (results, error)) {
g_prefix_error (error, "failed to get updates for refresh: ");
return FALSE;
/* download all the packages themselves */
/* download all the packages */
sack = pk_results_get_package_sack (results);
if (pk_package_sack_get_size (sack) == 0)
return TRUE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment