From 0a1724a0c6c2331353f04cb4c8d33171dfc9649e Mon Sep 17 00:00:00 2001 From: bbhtt Date: Mon, 9 Dec 2024 10:03:21 +0530 Subject: [PATCH] Update appstream to 1.0.4 Drop https://github.com/ximion/appstream/commit/6f6986c333ed9d56c28e5ff419b33fb4eb158bc2 patch --- org.flatpak.Builder.json | 7 +- patches/appstream-compose-lang-symlinks.patch | 107 ------------------ 2 files changed, 3 insertions(+), 111 deletions(-) delete mode 100644 patches/appstream-compose-lang-symlinks.patch diff --git a/org.flatpak.Builder.json b/org.flatpak.Builder.json index c942d62..421b8ae 100644 --- a/org.flatpak.Builder.json +++ b/org.flatpak.Builder.json @@ -75,8 +75,8 @@ "sources": [ { "type": "archive", - "url": "https://github.com/ximion/appstream/archive/refs/tags/v1.0.3.tar.gz", - "sha256": "dd7222519b5d855124fa803ce82a7cbf090ac6b2e44a5bc515e729b1f20a63ae", + "url": "https://github.com/ximion/appstream/archive/refs/tags/v1.0.4.tar.gz", + "sha256": "dff6efa67d9ea4797870d70e3370b9e3fa66ce3c749aba68e6b10222473463cf", "x-checker-data": { "type": "anitya", "project-id": 10385, @@ -90,8 +90,7 @@ "patches/appstream-demotion-allowlist.patch", "patches/appstream-compose-default-propagate-custom.patch", "patches/asc-hint-tags-silence-some-vague-validation-errors.patch", - "patches/compose-seperate-file-read-error.patch", - "patches/appstream-compose-lang-symlinks.patch" + "patches/compose-seperate-file-read-error.patch" ] } ] diff --git a/patches/appstream-compose-lang-symlinks.patch b/patches/appstream-compose-lang-symlinks.patch deleted file mode 100644 index 1722895..0000000 --- a/patches/appstream-compose-lang-symlinks.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 6f6986c333ed9d56c28e5ff419b33fb4eb158bc2 Mon Sep 17 00:00:00 2001 -From: Matthias Klumpp -Date: Wed, 5 Jun 2024 21:44:01 +0200 -Subject: [PATCH] compose: Allow file discovery even in symlinked directories - -This was discovered to be an issue on Flathub with some component -localizations being placed in symlinked directories. - -CC: https://github.com/flathub/flathub/issues/5272 ---- - compose/asc-directory-unit.c | 69 +++++++++++++++---- - 5 files changed, 65 insertions(+), 21 deletions(-) - -diff --git a/compose/asc-directory-unit.c b/compose/asc-directory-unit.c -index 80698e873..10c9c3de1 100644 ---- a/compose/asc-directory-unit.c -+++ b/compose/asc-directory-unit.c -@@ -81,11 +81,12 @@ asc_directory_unit_class_init (AscDirectoryUnitClass *klass) - } - - static gboolean --asc_directory_unit_find_files_recursive (GPtrArray *files, -- const gchar *path_orig, -- guint path_orig_len, -- const gchar *path, -- GError **error) -+asc_directory_unit_find_files_recursive_internal (GPtrArray *files, -+ const gchar *path_orig, -+ guint path_orig_len, -+ const gchar *path, -+ GHashTable *visited_dirs, -+ GError **error) - { - const gchar *tmp; - g_autoptr(GDir) dir = NULL; -@@ -104,14 +105,38 @@ asc_directory_unit_find_files_recursive (GPtrArray *files, - g_autofree gchar *path_new = NULL; - path_new = g_build_filename (path, tmp, NULL); - -- /* search recursively, don't follow symlinks */ -- if (g_file_test (path_new, G_FILE_TEST_IS_DIR) && -- !g_file_test (path_new, G_FILE_TEST_IS_SYMLINK)) { -- if (!asc_directory_unit_find_files_recursive (files, -- path_orig, -- path_orig_len, -- path_new, -- error)) -+ /* search recursively */ -+ if (g_file_test (path_new, G_FILE_TEST_IS_DIR)) { -+ if (g_file_test (path_new, G_FILE_TEST_IS_SYMLINK)) { -+ g_autofree gchar *real_path = realpath (path_new, NULL); -+ -+ if (!real_path) { -+ /* error if realpath fails (like memory allocation error or invalid path) */ -+ g_set_error (error, -+ G_FILE_ERROR, -+ g_file_error_from_errno (errno), -+ "Failed to resolve real path"); -+ return FALSE; -+ } -+ -+ /* don't visit paths twice to avoid loops */ -+ if (g_hash_table_contains (visited_dirs, real_path)) -+ return TRUE; -+ -+ g_hash_table_add (visited_dirs, g_steal_pointer (&real_path)); -+ } else { -+ if (g_hash_table_contains (visited_dirs, path_new)) -+ return TRUE; -+ -+ g_hash_table_add (visited_dirs, g_strdup (path_new)); -+ } -+ -+ if (!asc_directory_unit_find_files_recursive_internal (files, -+ path_orig, -+ path_orig_len, -+ path_new, -+ visited_dirs, -+ error)) - return FALSE; - } else { - g_ptr_array_add (files, g_strdup (path_new + path_orig_len)); -@@ -121,6 +146,24 @@ asc_directory_unit_find_files_recursive (GPtrArray *files, - return TRUE; - } - -+static gboolean -+asc_directory_unit_find_files_recursive (GPtrArray *files, -+ const gchar *path_orig, -+ guint path_orig_len, -+ const gchar *path, -+ GError **error) -+{ -+ g_autoptr(GHashTable) visited_dirs = NULL; -+ visited_dirs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); -+ -+ return asc_directory_unit_find_files_recursive_internal (files, -+ path_orig, -+ path_orig_len, -+ path, -+ visited_dirs, -+ error); -+} -+ - static gboolean - asc_directory_unit_open (AscUnit *unit, GError **error) - {