diff --git a/gtk-doc-fixxref-logging.patch b/gtk-doc-fixxref-logging.patch new file mode 100644 index 0000000..485a809 --- /dev/null +++ b/gtk-doc-fixxref-logging.patch @@ -0,0 +1,34 @@ +From 2d364e50140d17cf455365df537e5976d5d480d2 Mon Sep 17 00:00:00 2001 +From: Dominique Leuenberger +Date: Sat, 2 Dec 2017 16:11:50 +0100 +Subject: [PATCH] Use logging infrastructure for LogWarning + +Using pure 'print' statements often fail if we have a message containing +UTF-8, but output on a terminal/pipe not supporting UTF-8. + +Instead of trying to en/decode (and likely fail all the time) use logging.warning + +This causes a slight change of the format, as the log is prefixed with WARNING:root +but that seems better than crashing + +https://bugzilla.gnome.org/show_bug.cgi?id=791131 +--- + gtkdoc/common.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtkdoc/common.py b/gtkdoc/common.py +index ca82263..286f7f3 100644 +--- a/gtkdoc/common.py ++++ b/gtkdoc/common.py +@@ -148,7 +148,7 @@ def LogWarning(filename, line, message): + filename = filename or "unknown" + + # TODO: write to stderr +- print ("%s:%d: warning: %s" % (filename, line, message)) ++ logging.warning ("%s:%d: warning: %s" % (filename, line, message)) + + + def CreateValidSGMLID(xml_id): +-- +2.15.0 + diff --git a/gtk-doc.changes b/gtk-doc.changes index d5a4a76..717def1 100644 --- a/gtk-doc.changes +++ b/gtk-doc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Dec 2 15:17:35 UTC 2017 - dimstar@opensuse.org + +- Add gtk-doc-fixxref-logging.patch: Use logging infrastructure for + LogWarning (bgo#791131). + ------------------------------------------------------------------- Tue Oct 24 14:40:59 UTC 2017 - dimstar@opensuse.org diff --git a/gtk-doc.spec b/gtk-doc.spec index 2d8d4df..aadb80e 100644 --- a/gtk-doc.spec +++ b/gtk-doc.spec @@ -29,6 +29,8 @@ Source: https://download.gnome.org/sources/gtk-doc/1.26/%{name}-%{versio Patch0: gtk-doc-Generate-main-sgml.patch # PATCH-FIX-UPSTREAM gtk-doc-open-docs-as-utf8.patch dimstar@opensuse.org -- Always open files using utf-8 Patch1: gtk-doc-open-docs-as-utf8.patch +# PATCH-FIX-UPSTREAM gtk-doc-fixxref-logging.patch bgo#791131 dimstar@opensuse.org -- Use logging infrastructure for LogWarning +Patch2: gtk-doc-fixxref-logging.patch BuildRequires: docbook-xsl-stylesheets BuildRequires: libtool BuildRequires: libxml2-tools @@ -63,6 +65,7 @@ generate the documentation for GLib, Gtk+, and GNOME. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build autoreconf -fiv