[BACK]Return to patch-gobject_glib-mkenums.in CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / devel / glib2 / patches

Annotation of pkgsrc/devel/glib2/patches/patch-gobject_glib-mkenums.in, Revision 1.2

1.2     ! prlw1       1: $NetBSD$
1.1       prlw1       2:
1.2     ! prlw1       3: - Revert 4395a897 Use env to run the Python-based tools
        !             4:   https://bugzilla.gnome.org/show_bug.cgi?id=788527
        !             5: - Don't insist that authors' names in comments be encoded in utf-8
        !             6:   https://bugzilla.gnome.org/show_bug.cgi?id=785113
1.1       prlw1       7:
1.2     ! prlw1       8: --- gobject/glib-mkenums.in.orig       2017-10-21 08:20:09.664007702 +0000
1.1       prlw1       9: +++ gobject/glib-mkenums.in
                     10: @@ -1,4 +1,4 @@
                     11: -#!/usr/bin/env @PYTHON@
                     12: +#!@PYTHON@
                     13:
                     14:  # If the code below looks horrible and unpythonic, do not panic.
                     15:  #
1.2     ! prlw1      16: @@ -34,6 +34,11 @@ if sys.stdout.encoding is None:
        !            17:  else:
        !            18:      output_stream = sys.stdout
        !            19:
        !            20: +# Some source files aren't utf-8 and the old perl version didn't care.
        !            21: +# Replace invalid data with a replacement character to keep things working.
        !            22: +# https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20
        !            23: +decoding_errors = "replace"
        !            24: +
        !            25:  # pylint: disable=too-few-public-methods
        !            26:  class Color:
        !            27:      '''ANSI Terminal colors'''
        !            28: @@ -157,7 +162,8 @@ def parse_entries(file, file_name):
        !            29:          m = re.match(r'\#include\s*<([^>]*)>', line)
        !            30:          if m:
        !            31:              newfilename = os.path.join("..", m.group(1))
        !            32: -            newfile = io.open(newfilename, encoding="utf-8")
        !            33: +            newfile = io.open(newfilename, encoding="utf-8",
        !            34: +                              errors=decoding_errors)
        !            35:
        !            36:              if not parse_entries(newfile, newfilename):
        !            37:                  return False
        !            38: @@ -253,7 +259,7 @@ def read_template_file(file):
        !            39:             }
        !            40:      in_ = 'junk'
        !            41:
        !            42: -    ifile = io.open(file, encoding="utf-8")
        !            43: +    ifile = io.open(file, encoding="utf-8", errors=decoding_errors)
        !            44:      for line in ifile:
        !            45:          m = re.match(r'\/\*\*\*\s+(BEGIN|END)\s+([\w-]+)\s+\*\*\*\/', line)
        !            46:          if m:
        !            47: @@ -409,7 +415,8 @@ def process_file(curfilename):
        !            48:      firstenum = True
        !            49:
        !            50:      try:
        !            51: -        curfile = io.open(curfilename, encoding="utf-8")
        !            52: +        curfile = io.open(curfilename, encoding="utf-8",
        !            53: +                          errors=decoding_errors)
        !            54:      except IOError as e:
        !            55:          if e.errno == errno.ENOENT:
        !            56:              print_warning('No file "{}" found.'.format(curfilename))

CVSweb <webmaster@jp.NetBSD.org>