pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel Don't print characters that can't be converted t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7ab270db760f
branches:  trunk
changeset: 378127:7ab270db760f
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Apr 01 20:26:25 2018 +0000

description:
Don't print characters that can't be converted to UTF-8. Chances are,
they won't make it to stdout as well and break the tool, especially with
Python 2.7. Bump revision of glib2-tools.

diffstat:

 devel/glib2-tools/Makefile                        |   3 ++-
 devel/glib2/distinfo                              |   4 ++--
 devel/glib2/patches/patch-gobject_glib-mkenums.in |  17 +++++++++++++++--
 3 files changed, 19 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 8c9e7335364e -r 7ab270db760f devel/glib2-tools/Makefile
--- a/devel/glib2-tools/Makefile        Sun Apr 01 13:49:20 2018 +0000
+++ b/devel/glib2-tools/Makefile        Sun Apr 01 20:26:25 2018 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2017/11/07 15:53:11 prlw1 Exp $
+# $NetBSD: Makefile,v 1.4 2018/04/01 20:26:25 joerg Exp $
 
 .include "../../devel/glib2/Makefile.common"
 
 PKGNAME:=      ${PKGNAME:S/glib2/glib2-tools/}
+PKGREVISION=   1
 CATEGORIES=    devel gnome
 
 COMMENT=       GLib2/gobject python-dependent tools
diff -r 8c9e7335364e -r 7ab270db760f devel/glib2/distinfo
--- a/devel/glib2/distinfo      Sun Apr 01 13:49:20 2018 +0000
+++ b/devel/glib2/distinfo      Sun Apr 01 20:26:25 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.228 2018/01/28 16:51:50 wiz Exp $
+$NetBSD: distinfo,v 1.229 2018/04/01 20:26:25 joerg Exp $
 
 SHA1 (glib-2.54.3.tar.xz) = 12d7466550156ac8a765f603b0df7604cdf34cfd
 RMD160 (glib-2.54.3.tar.xz) = 7439dbf9d661352e7f2c1beae84b76e401798675
@@ -35,4 +35,4 @@
 SHA1 (patch-gobject_Makefile.am) = 6eed6b57f5ff0aa0dfb623110b23a3ff78aa4e75
 SHA1 (patch-gobject_Makefile.in) = a4768ff7b0607a8a4dfbb2cff087a987b451fd18
 SHA1 (patch-gobject_glib-genmarshal.in) = f21ca416d4eb4ad5a8ce3ffa053f8bcd2be8953a
-SHA1 (patch-gobject_glib-mkenums.in) = 22676989e47dfd13583d89469810af6ce7d01ab7
+SHA1 (patch-gobject_glib-mkenums.in) = 651713a9c1fd83aea5060f996b58b35fbe3a43c7
diff -r 8c9e7335364e -r 7ab270db760f devel/glib2/patches/patch-gobject_glib-mkenums.in
--- a/devel/glib2/patches/patch-gobject_glib-mkenums.in Sun Apr 01 13:49:20 2018 +0000
+++ b/devel/glib2/patches/patch-gobject_glib-mkenums.in Sun Apr 01 20:26:25 2018 +0000
@@ -1,9 +1,10 @@
-$NetBSD: patch-gobject_glib-mkenums.in,v 1.3 2018/01/28 16:51:51 wiz Exp $
+$NetBSD: patch-gobject_glib-mkenums.in,v 1.4 2018/04/01 20:26:25 joerg Exp $
 
 - Revert 4395a897 Use env to run the Python-based tools
   https://bugzilla.gnome.org/show_bug.cgi?id=788527
+- Do not print failing characters that might not be ASCII
 
---- gobject/glib-mkenums.in.orig       2017-10-21 08:20:09.664007702 +0000
+--- gobject/glib-mkenums.in.orig       2018-01-08 20:00:49.000000000 +0000
 +++ gobject/glib-mkenums.in
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env @PYTHON@
@@ -11,3 +12,15 @@
  
  # If the code below looks horrible and unpythonic, do not panic.
  #
+@@ -88,9 +88,8 @@ else:
+ # https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20
+ def replace_and_warn(err):
+     # 7 characters of context either side of the offending character
+-    print_warning('UnicodeWarning: {} at {} ({})'.format(
+-        err.reason, err.start,
+-        err.object[err.start - 7:err.end + 7]))
++    print_warning('UnicodeWarning: {} at {}'.format(
++        err.reason, err.start))
+     return ('?', err.end)
+ 
+ codecs.register_error('replace_and_warn', replace_and_warn)



Home | Main Index | Thread Index | Old Index