Backport a flatpakref installation fix

This commit is contained in:
Kalev Lember 2017-10-10 12:20:09 +02:00
parent b1a07a53a5
commit 254a769162
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 1a4c98b4ffa089985806a76a73d741465f3cff83 Mon Sep 17 00:00:00 2001
From: Joaquim Rocha <jrocha@endlessm.com>
Date: Sat, 1 Jul 2017 01:33:00 +0200
Subject: [PATCH] flatpak: Set the correct origin when installing a flatpakref
When installing a flatpakref, part of the process is to install its
ref file, and the code was assuming that this installation always
results in a new remote (named as app_name-origin). However, if there
is already a remote with the same URI as the one coming from the ref
file, it will not add the new one in order to avoid redudancy.
Since the GsApp representing the one in the flatpakref was being
assigned the "app_name-origin" as its origin, it would fail to install
later because this expected origin may not exist (as explained above).
To fix this, once the ref file is installed, we get the resulting
remote's name (i.e. a new one or the existing one) and override the
app's origin with it, which will allow the installation to succeed.
---
plugins/flatpak/gs-flatpak.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index af6834fb..a33aa060 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -2779,6 +2779,14 @@ gs_flatpak_app_install (GsFlatpak *self,
return FALSE;
}
+ /* the installation of the ref file above will not create a new remote for
+ * the app if its URL is already configured as another remote, thus we
+ * need to update the app origin to match that or it may end up with
+ * an nonexistent origin; and we first need to set the origin to NULL to
+ * circumvent the safety check... */
+ gs_app_set_origin (app, NULL);
+ gs_app_set_origin (app, flatpak_remote_ref_get_remote_name (xref2));
+
/* update search tokens for new remote */
if (!gs_flatpak_refresh_appstream (self, G_MAXUINT, 0, cancellable, error)) {
gs_app_set_state_recover (app);
--
2.14.1

View File

@ -14,13 +14,16 @@
Name: gnome-software Name: gnome-software
Version: 3.26.1 Version: 3.26.1
Release: 2%{?dist} Release: 3%{?dist}
Summary: A software center for GNOME Summary: A software center for GNOME
License: GPLv2+ License: GPLv2+
URL: https://wiki.gnome.org/Apps/Software URL: https://wiki.gnome.org/Apps/Software
Source0: https://download.gnome.org/sources/gnome-software/3.26/%{name}-%{version}.tar.xz Source0: https://download.gnome.org/sources/gnome-software/3.26/%{name}-%{version}.tar.xz
# Backported from upstream
Patch0: 0001-flatpak-Set-the-correct-origin-when-installing-a-fla.patch
BuildRequires: gettext BuildRequires: gettext
BuildRequires: libxslt BuildRequires: libxslt
BuildRequires: docbook-style-xsl BuildRequires: docbook-style-xsl
@ -240,6 +243,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_mandir}/man1/gnome-software-editor.1* %{_mandir}/man1/gnome-software-editor.1*
%changelog %changelog
* Tue Oct 10 2017 Kalev Lember <klember@redhat.com> - 3.26.1-3
- Backport a flatpakref installation fix
* Mon Oct 09 2017 Richard Hughes <rhughes@redhat.com> - 3.26.1-2 * Mon Oct 09 2017 Richard Hughes <rhughes@redhat.com> - 3.26.1-2
- Disable fwupd support until we get a 3.27.1 tarball - Disable fwupd support until we get a 3.27.1 tarball