diff --git a/backport-Implement-GFileIface.set_display_name-for-resource-files.patch b/backport-Implement-GFileIface.set_display_name-for-resource-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..00264fc0cf5ca48f346c0a4716208f9f44e4c3cc --- /dev/null +++ b/backport-Implement-GFileIface.set_display_name-for-resource-files.patch @@ -0,0 +1,52 @@ +From a9394bd68e222377f0156bf9c213b3f3a1e340d0 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Sat, 30 Jul 2022 20:03:42 +0100 +Subject: [PATCH] Implement GFileIface.set_display_name() for resource files + +Resource files cannot be renamed, and GFileIface.set_display_name() is +mandatory. + +Fixes: #2705 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a9394bd68e222377f0156bf9c213b3f3a1e340d0 + +--- + gio/gresourcefile.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/gio/gresourcefile.c b/gio/gresourcefile.c +index 340d3378b3..24f20f2903 100644 +--- a/gio/gresourcefile.c ++++ b/gio/gresourcefile.c +@@ -646,6 +646,19 @@ g_resource_file_monitor_file (GFile *file, + return g_object_new (g_resource_file_monitor_get_type (), NULL); + } + ++static GFile * ++g_resource_file_set_display_name (GFile *file, ++ const char *display_name, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ g_set_error_literal (error, ++ G_IO_ERROR, ++ G_IO_ERROR_NOT_SUPPORTED, ++ _("Resource files cannot be renamed")); ++ return NULL; ++} ++ + static void + g_resource_file_file_iface_init (GFileIface *iface) + { +@@ -664,6 +677,7 @@ g_resource_file_file_iface_init (GFileIface *iface) + iface->get_relative_path = g_resource_file_get_relative_path; + iface->resolve_relative_path = g_resource_file_resolve_relative_path; + iface->get_child_for_display_name = g_resource_file_get_child_for_display_name; ++ iface->set_display_name = g_resource_file_set_display_name; + iface->enumerate_children = g_resource_file_enumerate_children; + iface->query_info = g_resource_file_query_info; + iface->query_filesystem_info = g_resource_file_query_filesystem_info; +-- +GitLab + diff --git a/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch b/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch new file mode 100644 index 0000000000000000000000000000000000000000..28939fa5e11ea80a1f7508505282a4a9691f64c6 --- /dev/null +++ b/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch @@ -0,0 +1,67 @@ +From dad97d24d578dbefbebb41829b0ffb9e783cac7b Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 28 Oct 2022 11:21:04 -0400 +Subject: [PATCH] Revert "Handling collision between standard i/o file + descriptors and newly created ones" + +g_unix_open_pipe tries to avoid the standard io fd range +when getting pipe fds. This turns out to be a bad idea because +certain buggy programs rely on it using that range. + +This reverts commit d9ba6150909818beb05573f54f26232063492c5b + +Closes: #2795 +Reopens: #16 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/dad97d24d578dbefbebb41829b0ffb9e783cac7b + +--- + glib/glib-unix.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/glib/glib-unix.c b/glib/glib-unix.c +index 4710c51168..bc152d7663 100644 +--- a/glib/glib-unix.c ++++ b/glib/glib-unix.c +@@ -108,17 +108,6 @@ g_unix_open_pipe (int *fds, + ecode = pipe2 (fds, pipe2_flags); + if (ecode == -1 && errno != ENOSYS) + return g_unix_set_error_from_errno (error, errno); +- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ +- else if (fds[0] < 3 || fds[1] < 3) +- { +- int old_fds[2] = { fds[0], fds[1] }; +- gboolean result = g_unix_open_pipe (fds, flags, error); +- close (old_fds[0]); +- close (old_fds[1]); +- +- if (!result) +- g_unix_set_error_from_errno (error, errno); +- } + else if (ecode == 0) + return TRUE; + /* Fall through on -ENOSYS, we must be running on an old kernel */ +@@ -127,19 +116,6 @@ g_unix_open_pipe (int *fds, + ecode = pipe (fds); + if (ecode == -1) + return g_unix_set_error_from_errno (error, errno); +- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ +- else if (fds[0] < 3 || fds[1] < 3) +- { +- int old_fds[2] = { fds[0], fds[1] }; +- gboolean result = g_unix_open_pipe (fds, flags, error); +- close (old_fds[0]); +- close (old_fds[1]); +- +- if (!result) +- g_unix_set_error_from_errno (error, errno); +- +- return result; +- } + + if (flags == 0) + return TRUE; +-- +GitLab + diff --git a/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch b/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch new file mode 100644 index 0000000000000000000000000000000000000000..1067efccfc7b081ed0f903763d26c9862d1f7bcd --- /dev/null +++ b/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch @@ -0,0 +1,32 @@ +From d01fb412801ddc55843f1e1642d0fef0afba441a Mon Sep 17 00:00:00 2001 +From: John Lindgren +Date: Thu, 13 Oct 2022 14:00:12 +0100 +Subject: [PATCH] gmessages: Add missing trailing newline in fallback log + handler + +This makes the fallback log handler match the behaviour of the default +log handlers. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d01fb412801ddc55843f1e1642d0fef0afba441a + +Spotted as part of https://gitlab.gnome.org/GNOME/glib/-/issues/2753 +--- + glib/gmessages.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/glib/gmessages.c b/glib/gmessages.c +index fb1297f8a8..e197f1707a 100644 +--- a/glib/gmessages.c ++++ b/glib/gmessages.c +@@ -3159,6 +3159,7 @@ _g_log_fallback_handler (const gchar *log_domain, + write_string (stream, level_prefix); + write_string (stream, ": "); + write_string (stream, message); ++ write_string (stream, "\n"); + } + + static void +-- +GitLab + diff --git a/glib2.spec b/glib2.spec index d6f4d0f262818cb1f91519b4df6a4654d37890a4..12534600ed70872b04b491c64b339babd5fdc06f 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,6 +1,6 @@ Name: glib2 Version: 2.66.8 -Release: 8 +Release: 9 Summary: The core library that forms the basis for projects such as GTK+ and GNOME License: LGPLv2+ URL: http://www.gtk.org @@ -63,6 +63,9 @@ Patch6052: backport-gio-tests-gdbus-peer-Unref-cached-property-GVariant-val Patch6053: backport-gdesktopappinfo-Unref-the-GDBus-call-results.patch Patch6054: backport-Handling-collision-between-standard-i-o-file-descriptors-and-newly-created-ones.patch Patch6055: backport-glocalfileoutputstream-Do-not-double-close-an-fd-on-unlink-error.patch +Patch6056: backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch +Patch6057: backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch +Patch6058: backport-Implement-GFileIface.set_display_name-for-resource-files.patch BuildRequires: chrpath gcc gcc-c++ gettext perl-interpreter BuildRequires: desktop-file-utils shared-mime-info @@ -235,6 +238,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %endif %changelog +* Thu Feb 16 2023 hanhuihui - 2.66.8-9 +- backport some patches from community + * Mon Dec 26 2022 hanhuihui - 2.66.8-8 - backport some patches from community