summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhaedrus Leeds <mwleeds@endlessos.org>2020-11-25 17:19:11 -0800
committerAlexander Larsson <alexander.larsson@gmail.com>2020-12-09 09:03:31 +0100
commit2a8602ed8825fd2ba7151199759920f71041e29a (patch)
treec348b4f5c8a15e4cd478df870bdce51515089ad2
parentac155666723be412c2fec51a0039677b5ef32213 (diff)
downloadflatpak-2a8602ed8825fd2ba7151199759920f71041e29a.tar.gz
app: Swap order of rebase/uninstall calls
In case the second of these two fails, the first will still have been added to the transaction. And since it's better to install the renamed app but not uninstall the old one, than to uninstall the old one but not install the new one, swap the order. See also https://github.com/flatpak/flatpak/issues/3991
-rw-r--r--app/flatpak-cli-transaction.c4
-rw-r--r--app/flatpak-quiet-transaction.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c
index d90e1baf..a258f905 100644
--- a/app/flatpak-cli-transaction.c
+++ b/app/flatpak-cli-transaction.c
@@ -772,8 +772,8 @@ end_of_lifed_with_rebase (FlatpakTransaction *transaction,
{
g_autoptr(GError) error = NULL;
- if (!flatpak_transaction_add_uninstall (transaction, ref_str, &error) ||
- !flatpak_transaction_add_rebase (transaction, remote, rebased_to_ref, NULL, previous_ids, &error))
+ if (!flatpak_transaction_add_rebase (transaction, remote, rebased_to_ref, NULL, previous_ids, &error) ||
+ !flatpak_transaction_add_uninstall (transaction, ref_str, &error))
{
g_propagate_prefixed_error (&self->first_operation_error,
g_error_copy (error),
diff --git a/app/flatpak-quiet-transaction.c b/app/flatpak-quiet-transaction.c
index 0677661c..432254be 100644
--- a/app/flatpak-quiet-transaction.c
+++ b/app/flatpak-quiet-transaction.c
@@ -222,8 +222,8 @@ end_of_lifed_with_rebase (FlatpakTransaction *transaction,
g_print (_("Updating to rebased version\n"));
- if (!flatpak_transaction_add_uninstall (transaction, ref, &error) ||
- !flatpak_transaction_add_rebase (transaction, remote, rebased_to_ref, NULL, previous_ids, &error))
+ if (!flatpak_transaction_add_rebase (transaction, remote, rebased_to_ref, NULL, previous_ids, &error) ||
+ !flatpak_transaction_add_uninstall (transaction, ref, &error))
{
g_printerr (_("Failed to rebase %s to %s: %s\n"),
flatpak_ref_get_name (rref), rebased_to_ref, error->message);