daemon/transaction: Clear out libostree progress consistently

Prep for indicatif, the new progress implementation, which is now
more strict about overwriting tasks.  The `OstreeAsyncProgress`
object lingered on and could own tasks on the mainloop.  Narrow
the scope and avoid having one that crosses multiple pull requests.

Closes: #1661
Approved by: rfairley
This commit is contained in:
Colin Walters 2018-11-08 10:25:14 -05:00 committed by Atomic Bot
parent 2c4231b376
commit 0f5fc1afca

View File

@ -338,13 +338,12 @@ package_diff_transaction_execute (RpmostreedTransaction *transaction,
return FALSE;
}
g_autoptr(OstreeAsyncProgress) progress =
ostree_async_progress_new ();
rpmostreed_transaction_connect_download_progress (transaction, progress);
rpmostreed_transaction_connect_signature_progress (transaction, repo);
if (self->revision != NULL)
{
g_autoptr(OstreeAsyncProgress) progress = ostree_async_progress_new ();
rpmostreed_transaction_connect_download_progress (transaction, progress);
if (!apply_revision_override (transaction, repo, progress, origin,
self->revision, cancellable, error))
return FALSE;
@ -362,12 +361,14 @@ package_diff_transaction_execute (RpmostreedTransaction *transaction,
}
gboolean changed = FALSE;
if (!rpmostree_sysroot_upgrader_pull_base (upgrader, "/usr/share/rpm",
0, progress, &changed,
cancellable, error))
return FALSE;
rpmostree_transaction_emit_progress_end (RPMOSTREE_TRANSACTION (transaction));
{ g_autoptr(OstreeAsyncProgress) progress = ostree_async_progress_new ();
rpmostreed_transaction_connect_download_progress (transaction, progress);
if (!rpmostree_sysroot_upgrader_pull_base (upgrader, "/usr/share/rpm",
0, progress, &changed,
cancellable, error))
return FALSE;
rpmostree_transaction_emit_progress_end (RPMOSTREE_TRANSACTION (transaction));
}
if (!changed)
{
@ -860,14 +861,12 @@ deploy_transaction_execute (RpmostreedTransaction *transaction,
return FALSE;
}
g_autoptr(OstreeAsyncProgress) progress =
ostree_async_progress_new ();
rpmostreed_transaction_connect_download_progress (transaction, progress);
rpmostreed_transaction_connect_signature_progress (transaction, repo);
if (self->revision)
{
g_autoptr(OstreeAsyncProgress) progress = ostree_async_progress_new ();
rpmostreed_transaction_connect_download_progress (transaction, progress);
if (!apply_revision_override (transaction, repo, progress, origin,
self->revision, cancellable, error))
return FALSE;
@ -1138,9 +1137,12 @@ deploy_transaction_execute (RpmostreedTransaction *transaction,
if (download_metadata_only)
flags |= OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY;
g_autoptr(OstreeAsyncProgress) progress = ostree_async_progress_new ();
rpmostreed_transaction_connect_download_progress (transaction, progress);
if (!rpmostree_sysroot_upgrader_pull_base (upgrader, NULL, flags, progress,
&base_changed, cancellable, error))
return FALSE;
rpmostree_transaction_emit_progress_end (RPMOSTREE_TRANSACTION (transaction));
if (base_changed)
changed = TRUE;
@ -1266,9 +1268,6 @@ deploy_transaction_execute (RpmostreedTransaction *transaction,
return FALSE;
}
/* XXX: check if this is needed */
rpmostree_transaction_emit_progress_end (RPMOSTREE_TRANSACTION (transaction));
/* TODO - better logic for "changed" based on deployments */
if (changed || self->refspec)
{