glib2-2.68.2
This commit is contained in:
@@ -0,0 +1,79 @@
|
|||||||
|
Submitted By: Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
||||||
|
Rediffed By: Douglas R. Reno <renodr at linuxfromscratch dot org>
|
||||||
|
Date: 2017-10-15
|
||||||
|
Rediffed Date: 2021-04-01
|
||||||
|
Initial Package Version: 2.54.0
|
||||||
|
Upstream Status: Not submitted
|
||||||
|
Origin: Self
|
||||||
|
Description: Adds a capabiility to skip printing warning messages using
|
||||||
|
an environment variable: GLIB_LOG_LEVEL. The value
|
||||||
|
of the variable is a digit that correponds to:
|
||||||
|
1 Alert
|
||||||
|
2 Critical
|
||||||
|
3 Error
|
||||||
|
4 Warning
|
||||||
|
5 Notice
|
||||||
|
|
||||||
|
For instance GLIB_LOG_LEVEL=4 will skip output of Warning and
|
||||||
|
Notice messages (and Info/Debug messages if they are turned on).
|
||||||
|
|
||||||
|
Rediffed for 2.68.0 to reduce the fuzz warnings.
|
||||||
|
|
||||||
|
diff -Naurp glib-2.68.0.orig/glib/gmessages.c glib-2.68.0/glib/gmessages.c
|
||||||
|
--- glib-2.68.0.orig/glib/gmessages.c 2021-03-18 08:28:31.909625000 -0500
|
||||||
|
+++ glib-2.68.0/glib/gmessages.c 2021-04-01 20:32:23.517596280 -0500
|
||||||
|
@@ -528,6 +528,34 @@ static GDestroyNotify log_writer_user_da
|
||||||
|
|
||||||
|
/* --- functions --- */
|
||||||
|
|
||||||
|
+/* skip_message
|
||||||
|
+ *
|
||||||
|
+ * This internal function queries an optional environment variable,
|
||||||
|
+ * GLIB_LOG_LEVEL and converts it to a value consistent
|
||||||
|
+ * with the type GLogLevelFlags. If the value is equal to
|
||||||
|
+ * or greater than the integer equivalent of the log_level,
|
||||||
|
+ * then the function returns a boolean that indicates that
|
||||||
|
+ * logging the output should be skipped.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+static gboolean skip_message( GLogLevelFlags log_level);
|
||||||
|
+
|
||||||
|
+static gboolean skip_message( GLogLevelFlags log_level)
|
||||||
|
+{
|
||||||
|
+ char* user_log_level;
|
||||||
|
+ int user_log_int;
|
||||||
|
+ gboolean skip = FALSE;
|
||||||
|
+
|
||||||
|
+ user_log_level = getenv( "GLIB_LOG_LEVEL" );
|
||||||
|
+
|
||||||
|
+ user_log_int = ( user_log_level != NULL ) ? atoi( user_log_level ) : 0;
|
||||||
|
+ user_log_int = ( user_log_level != 0 ) ? 1 << user_log_int : 0;
|
||||||
|
+
|
||||||
|
+ if ( user_log_int >= log_level ) skip = TRUE;
|
||||||
|
+
|
||||||
|
+ return skip;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void _g_log_abort (gboolean breakpoint);
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -2591,6 +2619,9 @@ g_log_writer_standard_streams (GLogLevel
|
||||||
|
g_return_val_if_fail (fields != NULL, G_LOG_WRITER_UNHANDLED);
|
||||||
|
g_return_val_if_fail (n_fields > 0, G_LOG_WRITER_UNHANDLED);
|
||||||
|
|
||||||
|
+ /* If the user does not want this message level, just return */
|
||||||
|
+ if ( skip_message( log_level) ) return G_LOG_WRITER_HANDLED;
|
||||||
|
+
|
||||||
|
stream = log_level_to_file (log_level);
|
||||||
|
if (!stream || fileno (stream) < 0)
|
||||||
|
return G_LOG_WRITER_UNHANDLED;
|
||||||
|
@@ -2818,6 +2849,9 @@ _g_log_writer_fallback (GLogLevelFlags
|
||||||
|
FILE *stream;
|
||||||
|
gsize i;
|
||||||
|
|
||||||
|
+ /* If the user does not want this message level, just return */
|
||||||
|
+ if ( skip_message( log_level) ) return G_LOG_WRITER_HANDLED;
|
||||||
|
+
|
||||||
|
/* we cannot call _any_ GLib functions in this fallback handler,
|
||||||
|
* which is why we skip UTF-8 conversion, etc.
|
||||||
|
* since we either recursed or ran out of memory, we're in a pretty
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<IsA>library</IsA>
|
<IsA>library</IsA>
|
||||||
<Summary>A library of handy utility functions</Summary>
|
<Summary>A library of handy utility functions</Summary>
|
||||||
<Description>glib2 is the low-level core library that forms the basis for projects such as GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.</Description>
|
<Description>glib2 is the low-level core library that forms the basis for projects such as GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.</Description>
|
||||||
<Archive sha1sum="93fbcb5fd4c602cdd53c934d8d947eb9bc9e6256" type="tarxz">mirrors://gnome/glib/2.66/glib-2.66.2.tar.xz</Archive>
|
<Archive sha1sum="7589cec921663c861044ea5e78c383b1c13bb4ce" type="tarxz">mirrors://gnome/glib/2.68/glib-2.68.2.tar.xz</Archive>
|
||||||
<BuildDependencies>
|
<BuildDependencies>
|
||||||
<Dependency>meson</Dependency>
|
<Dependency>meson</Dependency>
|
||||||
<Dependency>ninja</Dependency>
|
<Dependency>ninja</Dependency>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<Patches>
|
<Patches>
|
||||||
<Patch level="1">noisy-glib-compile-schemas.diff</Patch>
|
<Patch level="1">noisy-glib-compile-schemas.diff</Patch>
|
||||||
<!-- <Patch level="1">CVE-2020-6750.patch</Patch> -->
|
<!-- <Patch level="1">CVE-2020-6750.patch</Patch> -->
|
||||||
<Patch level="1">glib-2.62.4-skip_warnings-1.patch</Patch>
|
<Patch level="1">glib-2.68.2-skip_warnings-1.patch</Patch>
|
||||||
</Patches>
|
</Patches>
|
||||||
<AdditionalFiles>
|
<AdditionalFiles>
|
||||||
<AdditionalFile target="multilib.diff" permission="0644">multilib.diff</AdditionalFile>
|
<AdditionalFile target="multilib.diff" permission="0644">multilib.diff</AdditionalFile>
|
||||||
@@ -141,6 +141,13 @@
|
|||||||
</Package>
|
</Package>
|
||||||
|
|
||||||
<History>
|
<History>
|
||||||
|
<Update release="15">
|
||||||
|
<Date>2021-05-27</Date>
|
||||||
|
<Version>2.68.2</Version>
|
||||||
|
<Comment>Version bump.</Comment>
|
||||||
|
<Name>Mustafa Cinasal</Name>
|
||||||
|
<Email>muscnsl@gmail.com</Email>
|
||||||
|
</Update>
|
||||||
<Update release="14">
|
<Update release="14">
|
||||||
<Date>2021-05-03</Date>
|
<Date>2021-05-03</Date>
|
||||||
<Version>2.66.2</Version>
|
<Version>2.66.2</Version>
|
||||||
|
|||||||
Reference in New Issue
Block a user