temp/gnome-software: upgrade to 41.5

This commit is contained in:
Pablo Correa Gómez 2022-05-10 14:54:27 +02:00
parent b630c1a3d1
commit 131b686bf6
7 changed files with 107 additions and 175 deletions

View File

@ -1,7 +1,7 @@
From 3a7f4e433b9909ae1a92f7bd25de37dbefc76db8 Mon Sep 17 00:00:00 2001
From 715db5606279efbb5b47ae734db7ffd407b25d79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Tue, 28 Dec 2021 20:03:00 +0100
Subject: [PATCH 1/5] gs-external-appstream-utils: use
Subject: [PATCH] gs-external-appstream-utils: use
external-appstream-system-wide key
The key had been defined when it was introduced, but it was not
@ -22,7 +22,7 @@ in this commit
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/gs-external-appstream-utils.c b/lib/gs-external-appstream-utils.c
index 73c56744..39d71b29 100644
index 73c567443..39d71b299 100644
--- a/lib/gs-external-appstream-utils.c
+++ b/lib/gs-external-appstream-utils.c
@@ -236,7 +236,7 @@ gs_external_appstream_refresh_url (GsPlugin *plugin,
@ -35,5 +35,5 @@ index 73c56744..39d71b29 100644
cache_age,
cancellable,
--
2.25.1
2.36.1

View File

@ -1,7 +1,7 @@
From 5bc338da693cb7590b9b039548b0624fd244d311 Mon Sep 17 00:00:00 2001
From 1cb77595a81b8a848a30948fbe5506e209b621df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Thu, 30 Dec 2021 00:24:32 +0100
Subject: [PATCH 1/2] make updates page default at startup
Subject: [PATCH] make updates page default at startup
This is mostly to avoid having the startup of an application
show a window that looks broken. It should be reverted once
@ -18,7 +18,7 @@ might be possible but out of scope
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gs-application.c b/src/gs-application.c
index 90487df6..d35edc1c 100644
index 90487df62..d35edc1c5 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -1064,7 +1064,7 @@ gs_application_activate (GApplication *application)
@ -31,7 +31,7 @@ index 90487df6..d35edc1c 100644
gs_shell_activate (GS_APPLICATION (application)->shell);
diff --git a/src/org.gnome.Software.desktop.in b/src/org.gnome.Software.desktop.in
index 318c243a..b79666eb 100644
index 318c243af..b79666eb4 100644
--- a/src/org.gnome.Software.desktop.in
+++ b/src/org.gnome.Software.desktop.in
@@ -3,7 +3,7 @@ Name=Software
@ -44,5 +44,5 @@ index 318c243a..b79666eb 100644
Type=Application
Categories=GNOME;GTK;System;PackageManager;
--
2.25.1
2.36.1

View File

@ -1,7 +1,7 @@
From f85b328d0269630e51db33aef23350eb77e3d2b4 Mon Sep 17 00:00:00 2001
From 5fa86de04924801104431d09be254ee049be7d1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Mon, 17 Jan 2022 01:40:42 +0100
Subject: [PATCH 2/2] disable "Automatic Updates" options
Subject: [PATCH] disable "Automatic Updates" options
Those can be dangerous, as applications are updated live, and
kernel or mkinitfs could be installed at any time. This includes
@ -14,7 +14,7 @@ solve this issue in pma#1388
1 file changed, 2 insertions(+)
diff --git a/src/gs-prefs-dialog.ui b/src/gs-prefs-dialog.ui
index 2ccde058..3094b5c1 100644
index 2ccde058f..3094b5c17 100644
--- a/src/gs-prefs-dialog.ui
+++ b/src/gs-prefs-dialog.ui
@@ -18,6 +18,7 @@
@ -34,5 +34,5 @@ index 2ccde058..3094b5c1 100644
<property name="title" translatable="yes">Automatic Update Notifications</property>
<property name="subtitle" translatable="yes">Show notifications when updates have been automatically installed.</property>
--
2.25.1
2.36.1

View File

@ -1,8 +1,7 @@
From 413f67451c89d269d3b373cefd4b3a9bb500960e Mon Sep 17 00:00:00 2001
From c877bd004188fbfb2a7ff5ee539614a77d89e741 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Fri, 31 Dec 2021 00:46:38 +0100
Subject: [PATCH 2/5] gs-external-appstream-utils: hash url to allow same
basename
Subject: [PATCH] gs-external-appstream-utils: hash url to allow same basename
Component files generated by tools like appstream-generator all
have the same basename: Components-$(ARCH).xml.gz
@ -19,7 +18,7 @@ basename solves this problem.
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/lib/gs-external-appstream-utils.c b/lib/gs-external-appstream-utils.c
index 39d71b29..82c5f700 100644
index 39d71b299..82c5f7001 100644
--- a/lib/gs-external-appstream-utils.c
+++ b/lib/gs-external-appstream-utils.c
@@ -87,6 +87,7 @@ gs_external_appstream_get_modification_date (const gchar *file_path)
@ -107,5 +106,5 @@ index 39d71b29..82c5f700 100644
}
--
2.25.1
2.36.1

View File

@ -1,148 +0,0 @@
From 55c53080dbbd2d81ebd0c3d98bb0e0831d6064d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Sat, 15 Jan 2022 22:51:10 +0100
Subject: [PATCH 3/5] appstream: implement parsing media_baseurl
This property was not documented for XML data until quite
recently: https://github.com/ximion/appstream/pull/371
However, remote icons and screenshots generated with appstream-generator
only contain urls relative to media_baseurl property. Fix all relative uris
prepending the corresponding media_baseurl for those objects to be downloadable.
---
lib/gs-appstream.c | 19 +++++++++
lib/gs-appstream.h | 2 +
plugins/core/gs-plugin-appstream.c | 64 ++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index df91dd0f..8e157595 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1824,3 +1824,22 @@ gs_appstream_component_add_extra_info (XbBuilderNode *component)
break;
}
}
+
+/* Resolve any media URIs which are actually relative
+ * paths against the media_baseurl property */
+void
+gs_appstream_component_fix_url (XbBuilderNode *component, const gchar *baseurl)
+{
+ const gchar *text = xb_builder_node_get_text (component);
+ g_autofree gchar *url = NULL;
+
+ if (text == NULL)
+ return;
+
+ if (g_str_has_prefix (text, "http:") ||
+ g_str_has_prefix (text, "https:"))
+ return;
+
+ url = g_strconcat (baseurl, "/", text, NULL);
+ xb_builder_node_set_text (component, url , -1);
+}
diff --git a/lib/gs-appstream.h b/lib/gs-appstream.h
index 5bddf913..fbc68a1a 100644
--- a/lib/gs-appstream.h
+++ b/lib/gs-appstream.h
@@ -72,5 +72,7 @@ void gs_appstream_component_add_icon (XbBuilderNode *component,
const gchar *str);
void gs_appstream_component_add_provide (XbBuilderNode *component,
const gchar *str);
+void gs_appstream_component_fix_url (XbBuilderNode *component,
+ const gchar *baseurl);
G_END_DECLS
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 5d61c5b6..950316f2 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -133,6 +133,60 @@ gs_plugin_appstream_add_origin_keyword_cb (XbBuilderFixup *self,
return TRUE;
}
+static void
+gs_plugin_appstream_media_baseurl_free (gpointer user_data)
+{
+ g_string_free ((GString *) user_data, TRUE);
+}
+
+static gboolean
+gs_plugin_appstream_media_baseurl_cb (XbBuilderFixup *self,
+ XbBuilderNode *bn,
+ gpointer user_data,
+ GError **error)
+{
+ GString *baseurl = user_data;
+ if (g_strcmp0 (xb_builder_node_get_element (bn), "components") == 0) {
+ const gchar *url = xb_builder_node_get_attr (bn, "media_baseurl");
+ if (url == NULL) {
+ g_string_truncate (baseurl, 0);
+ return TRUE;
+ }
+ g_string_assign (baseurl, url);
+ return TRUE;
+ }
+
+ if (baseurl->len == 0)
+ return TRUE;
+
+ if (g_strcmp0 (xb_builder_node_get_element (bn), "icon") == 0) {
+ const gchar *type = xb_builder_node_get_attr (bn, "type");
+ if (g_strcmp0 (type, "remote") != 0)
+ return TRUE;
+ gs_appstream_component_fix_url (bn, baseurl->str);
+ } else if (g_strcmp0 (xb_builder_node_get_element (bn), "screenshots") == 0) {
+ GPtrArray *screenshots = xb_builder_node_get_children (bn);
+ for (guint i = 0; i < screenshots->len; i++) {
+ XbBuilderNode *screenshot = g_ptr_array_index (screenshots, i);
+ GPtrArray *children = NULL;
+ /* Type-check for security */
+ if (g_strcmp0 (xb_builder_node_get_element (screenshot), "screenshot") != 0) {
+ continue;
+ }
+ children = xb_builder_node_get_children (screenshot);
+ for (guint j = 0; j < children->len; j++) {
+ XbBuilderNode *child = g_ptr_array_index (children, j);
+ const gchar *element = xb_builder_node_get_element (child);
+ if (g_strcmp0 (element, "image") != 0 &&
+ g_strcmp0 (element, "video") != 0)
+ continue;
+ gs_appstream_component_fix_url (child, baseurl->str);
+ }
+ }
+ }
+ return TRUE;
+}
+
static gboolean
gs_plugin_appstream_load_appdata_fn (GsPlugin *plugin,
XbBuilder *builder,
@@ -398,6 +452,8 @@ gs_plugin_appstream_load_appstream_fn (GsPlugin *plugin,
#if LIBXMLB_CHECK_VERSION(0,3,1)
g_autoptr(XbBuilderFixup) fixup4 = NULL;
#endif
+ g_autoptr(XbBuilderFixup) fixup5 = NULL;
+ GString *media_baseurl = g_string_new (NULL);
g_autoptr(XbBuilderSource) source = xb_builder_source_new ();
/* add support for DEP-11 files */
@@ -453,6 +509,14 @@ gs_plugin_appstream_load_appstream_fn (GsPlugin *plugin,
xb_builder_source_add_fixup (source, fixup4);
#endif
+ /* prepend media_baseurl to remote relative URLs */
+ fixup5 = xb_builder_fixup_new ("MediaBaseUrl",
+ gs_plugin_appstream_media_baseurl_cb,
+ media_baseurl,
+ gs_plugin_appstream_media_baseurl_free);
+ xb_builder_fixup_set_max_depth (fixup5, 3);
+ xb_builder_source_add_fixup (source, fixup5);
+
/* success */
xb_builder_import_source (builder, source);
return TRUE;
--
2.25.1

View File

@ -0,0 +1,81 @@
From d971b745734ae13219f5f66684ad4127923ab3e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Tue, 22 Feb 2022 22:26:35 +0100
Subject: [PATCH] lib: cleanup public headers and mark gs-test.h as public
Backport of https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1192
to fix building test in the out-of-tree plugin
---
lib/gs-app-list-private.h | 1 -
lib/gs-app-list.h | 1 +
lib/gs-plugin-job.h | 2 +-
lib/gs-plugin-loader.h | 2 +-
lib/meson.build | 1 +
5 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/gs-app-list-private.h b/lib/gs-app-list-private.h
index 3bf908c16..9f540a620 100644
--- a/lib/gs-app-list-private.h
+++ b/lib/gs-app-list-private.h
@@ -33,7 +33,6 @@ typedef enum {
GS_APP_LIST_FLAG_LAST /*< skip >*/
} GsAppListFlags;
-GsAppList *gs_app_list_copy (GsAppList *list);
guint gs_app_list_get_size_peak (GsAppList *list);
void gs_app_list_filter_duplicates (GsAppList *list,
GsAppListFilterFlags flags);
diff --git a/lib/gs-app-list.h b/lib/gs-app-list.h
index 1330e8048..80e5e5976 100644
--- a/lib/gs-app-list.h
+++ b/lib/gs-app-list.h
@@ -65,6 +65,7 @@ typedef gboolean (*GsAppListFilterFunc) (GsApp *app,
gpointer user_data);
GsAppList *gs_app_list_new (void);
+GsAppList *gs_app_list_copy (GsAppList *list);
void gs_app_list_add (GsAppList *list,
GsApp *app);
void gs_app_list_add_list (GsAppList *list,
diff --git a/lib/gs-plugin-job.h b/lib/gs-plugin-job.h
index 2bd619c63..47420b4fe 100644
--- a/lib/gs-plugin-job.h
+++ b/lib/gs-plugin-job.h
@@ -10,7 +10,7 @@
#include <glib-object.h>
-#include "gs-app-list-private.h"
+#include "gs-app-list.h"
#include "gs-category.h"
#include "gs-plugin-types.h"
diff --git a/lib/gs-plugin-loader.h b/lib/gs-plugin-loader.h
index 71fd35af8..bd56bc0d4 100644
--- a/lib/gs-plugin-loader.h
+++ b/lib/gs-plugin-loader.h
@@ -16,8 +16,8 @@
#include "gs-category-manager.h"
#include "gs-odrs-provider.h"
#include "gs-plugin-event.h"
-#include "gs-plugin-private.h"
#include "gs-plugin-job.h"
+#include "gs-plugin.h"
G_BEGIN_DECLS
diff --git a/lib/meson.build b/lib/meson.build
index 3b8c92339..ceb2ea9a9 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libgnomesoftware_public_headers = [
'gs-plugin-types.h',
'gs-plugin-vfuncs.h',
'gs-remote-icon.h',
+ 'gs-test.h',
'gs-utils.h'
]
--
2.36.1

View File

@ -1,8 +1,8 @@
# Forked from Alpine to apply adaptability patches
pkgname=gnome-software
pkgver=9999_git20211203
_pkgver=41.3
pkgrel=2
_pkgver=41.5
pkgrel=3
pkgdesc="Software lets you install and update applications and system extensions"
url="https://wiki.gnome.org/Apps/Software"
# s390x, mips64 and riscv64 blocked by polkit
@ -24,7 +24,7 @@ _purism_patches="https://source.puri.sm/Librem5/pureos-store/-/raw/$_purism_comm
source="https://download.gnome.org/sources/gnome-software/${_pkgver%.*}/gnome-software-$_pkgver.tar.xz
0001-gs-external-appstream-utils-use-external-appstream-s.patch
0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
0003-appstream-implement-parsing-media_baseurl.patch
0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch
0001-make-updates-page-default-at-startup.patch
0002-disable-Automatic-Updates-options.patch
$_purism_patches/ui/0001-assets-Make-the-up-to-date-picture-fit-phones.patch
@ -101,12 +101,12 @@ flatpak_plugin() {
}
sha512sums="
7b19ed7e3b6f8662b6351fbb6eddb45f99cdbf9e6912e11b36301cdfd6f62cb3256da031e6640f9ad397384a23530d11488c78a1af60ce130a99838f97f8a0ed gnome-software-41.3.tar.xz
9f08078c9f0df149bc3be65fdcd47e7e1c11023c9fdbfe3fa63bb7f67883cd2ac654e8aa941d1b222b85d600a9cfeed8fb1d0d43091236c8e0e137d4035705a1 0001-gs-external-appstream-utils-use-external-appstream-s.patch
c4ca14d981da8fc93800178aeb2480c8bcaa524a0db283613047e769d4dd8aa9ee603d86cf1353818454e14e25d68b11858e2658e6ff5d7b3fa57c075800deb2 0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
986cf69e34d61daea61d6555efc2e4805baf07d6a71fdf0c1e35fd38aef64b50924f64b5650d26d1a5c9841d29cffd3bb2cc869f55ba0c1763b929d5e21cb7b9 0003-appstream-implement-parsing-media_baseurl.patch
388910611f93147ab55ec602035baac6b85cdece9164d2205669ad41adc6a7cdf4d37d7eaf2eee51257bf905ff39eb0a2502679abeb4d95025ab1296ac0adc94 0001-make-updates-page-default-at-startup.patch
40c3aab58f050f88769e6265926762217324ed7748bee7bc3981a04e785133b71b81603dcc22f79c79ecb75298cdca07511031906c5c1eee5d2f122e3d8dab0c 0002-disable-Automatic-Updates-options.patch
60701d50dd8e7fa01c05c8ee7823b053d40b0fa145419601ece732827527d4d7ae9af178b5b6622ac4d729d3d430c14981a2fd4b0f086dd6d05a49fd507f2cb6 gnome-software-41.5.tar.xz
52e4f99a4e1e2e688b1dcb146bcad3f3ba0e804af841d3837de5a7905f90689dc6258e625476a5fa402e8cfb5f7b814f3bdb0cf0dfab5ca8ebbf6193099e9916 0001-gs-external-appstream-utils-use-external-appstream-s.patch
467e023cc953f1d7caf83a4087f7f6311f64d20da32dafb2a97bd7488bb597e2d407d1166937c1776c0add199508ac45f361d7754687f638e518dbfaa8f80c6e 0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
4f3248916d8d15753dc22580e71a37cbfd42bb81ee0befcc51cbbbc5ce8a6573be9dae8d049c9c10fbdcf6292b83fda0d2175d1f6554e7ee8f08024ce6bdffe9 0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch
b7c873701faba9963eafae0f2a096f783387da47b0ef04ec863dfa693c9415328238780ae2ab4f6c0910ccb1a023d8e94b1010249dec64f19c081e7a686783a3 0001-make-updates-page-default-at-startup.patch
bc1c1ca45a475be511781b2cebd59a0c8ea540b17ab9faa59bf1b0478f32b96c974db46e07b2cc56b6c13f1b590b339fd01f907a648ae0fe689522d56d89e875 0002-disable-Automatic-Updates-options.patch
ea2d4c6ee37b1fb27773d8908a98e6f6726cd2f72fcc7c41caf243a501896c991346d02ccbc36168c7194d0ba3dfd17660c7af79305a447f521617f0fbefae9e 0001-assets-Make-the-up-to-date-picture-fit-phones.patch
4e5b205134d7fc8c60af2e9fcfa70552e20300b2e9959d500a82546986d38677515af841272ef64a019ec946940c59eaca3d95d228952d8384682c7410383417 0002-Add-GsInfoWindow.patch
b67d04f6853762b7d5b26109fdeeec37d07bef40d1e35b46d95ec58e977c1088e256d0e272bc05c764d8673b2766ec82861506415ee11237ee0270a8a0732d97 0003-metered-data-dialog-Make-it-a-GsInfoWindow-and-a-Hdy.patch