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

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /pkgsrc/devel/glib2/patches/patch-gobject_glib-mkenums.in between version 1.2 and 1.3

version 1.2, 2017/10/21 08:57:33 version 1.3, 2018/01/28 16:51:51
Line 2  $NetBSD$
Line 2  $NetBSD$
   
 - Revert 4395a897 Use env to run the Python-based tools  - Revert 4395a897 Use env to run the Python-based tools
   https://bugzilla.gnome.org/show_bug.cgi?id=788527    https://bugzilla.gnome.org/show_bug.cgi?id=788527
 - Don't insist that authors' names in comments be encoded in utf-8  
   https://bugzilla.gnome.org/show_bug.cgi?id=785113  
   
 --- gobject/glib-mkenums.in.orig        2017-10-21 08:20:09.664007702 +0000  --- gobject/glib-mkenums.in.orig        2017-10-21 08:20:09.664007702 +0000
 +++ gobject/glib-mkenums.in  +++ gobject/glib-mkenums.in
Line 13  $NetBSD$
Line 11  $NetBSD$
   
  # If the code below looks horrible and unpythonic, do not panic.   # If the code below looks horrible and unpythonic, do not panic.
  #   #
 @@ -34,6 +34,11 @@ if sys.stdout.encoding is None:  
  else:  
      output_stream = sys.stdout  
   
 +# Some source files aren't utf-8 and the old perl version didn't care.  
 +# Replace invalid data with a replacement character to keep things working.  
 +# https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20  
 +decoding_errors = "replace"  
 +  
  # pylint: disable=too-few-public-methods  
  class Color:  
      '''ANSI Terminal colors'''  
 @@ -157,7 +162,8 @@ def parse_entries(file, file_name):  
          m = re.match(r'\#include\s*<([^>]*)>', line)  
          if m:  
              newfilename = os.path.join("..", m.group(1))  
 -            newfile = io.open(newfilename, encoding="utf-8")  
 +            newfile = io.open(newfilename, encoding="utf-8",  
 +                              errors=decoding_errors)  
   
              if not parse_entries(newfile, newfilename):  
                  return False  
 @@ -253,7 +259,7 @@ def read_template_file(file):  
             }  
      in_ = 'junk'  
   
 -    ifile = io.open(file, encoding="utf-8")  
 +    ifile = io.open(file, encoding="utf-8", errors=decoding_errors)  
      for line in ifile:  
          m = re.match(r'\/\*\*\*\s+(BEGIN|END)\s+([\w-]+)\s+\*\*\*\/', line)  
          if m:  
 @@ -409,7 +415,8 @@ def process_file(curfilename):  
      firstenum = True  
   
      try:  
 -        curfile = io.open(curfilename, encoding="utf-8")  
 +        curfile = io.open(curfilename, encoding="utf-8",  
 +                          errors=decoding_errors)  
      except IOError as e:  
          if e.errno == errno.ENOENT:  
              print_warning('No file "{}" found.'.format(curfilename))  

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

CVSweb <webmaster@jp.NetBSD.org>