From 5cff4500a2d685c1b81241dbaf2b7afb2a6dc5ae Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Thu, 16 Aug 2018 18:17:30 -0700 Subject: [PATCH] transaction: Fix error handling for related refs This commit fixes the handling of errors from installing/updating related refs during a transaction, so that they're treated as non-fatal, and so that the operation is skipped if the primary operation fails. The current behavior is that a failure to install/update a related ref causes the whole transaction to fail, and even after a failure to install/update the primary ref the related ref install/update is attempted. I hit this error when doing an offline USB app install, when the USB repo has an older version of the runtime and the runtime's locale extension than what's in the local repo. Without this commit, the failure to update the runtime (due to it being a downgrade) is treated as a warning, but the failure to update the runtime locale is treated as an error. With this commit, the runtime update failure is still treated as a warning, and the locale update is not attempted. This is better behavior because the locale extension update (or even install) is not critical to the app install. Closes: #1979 Approved by: alexlarsson --- common/flatpak-transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/flatpak-transaction.c b/common/flatpak-transaction.c index c3a93d70..b93b8840 100644 --- a/common/flatpak-transaction.c +++ b/common/flatpak-transaction.c @@ -1152,8 +1152,8 @@ add_related (FlatpakTransaction *self, (const char **) rel->subpaths, NULL, NULL, FLATPAK_TRANSACTION_OPERATION_INSTALL_OR_UPDATE); - op->non_fatal = TRUE; - op->fail_if_op_fails = op; + related_op->non_fatal = TRUE; + related_op->fail_if_op_fails = op; run_operation_before (op, related_op, 1); } }