pkgsrc-Changes archive

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

CVS commit: pkgsrc/editors/medit



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Sun Apr 11 00:58:16 UTC 2021

Modified Files:
        pkgsrc/editors/medit: Makefile distinfo
Added Files:
        pkgsrc/editors/medit/patches: patch-tools_glade2c.py
            patch-tools_xml2h.py

Log Message:
medit: apply mechanical patches to python scripts for python3. PR/56088

"If it works for you, please just commit it" from wiz@.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 pkgsrc/editors/medit/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/editors/medit/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/editors/medit/patches/patch-tools_glade2c.py \
    pkgsrc/editors/medit/patches/patch-tools_xml2h.py

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

Modified files:

Index: pkgsrc/editors/medit/Makefile
diff -u pkgsrc/editors/medit/Makefile:1.46 pkgsrc/editors/medit/Makefile:1.47
--- pkgsrc/editors/medit/Makefile:1.46  Thu Nov  5 09:08:02 2020
+++ pkgsrc/editors/medit/Makefile       Sun Apr 11 00:58:16 2021
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.46 2020/11/05 09:08:02 ryoon Exp $
+# $NetBSD: Makefile,v 1.47 2021/04/11 00:58:16 tsutsui Exp $
 
 DISTNAME=      medit-1.2.0
-PKGREVISION=   16
+PKGREVISION=   17
 CATEGORIES=    editors
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=mooedit/}
 EXTRACT_SUFX=  .tar.bz2
@@ -19,7 +19,7 @@ USE_LANGUAGES=        c c++
 USE_TOOLS+=    gmake pkg-config msgfmt intltool
 
 PYTHON_FOR_BUILD_ONLY=         yes
-PYTHON_VERSIONS_ACCEPTED=      27 # not yet ported as of 1.2.0
+PYTHON_VERSIONS_INCOMPATIBLE+= 27
 CONFIGURE_ARGS+=               --with-python=no
 CONFIGURE_ENV+=                        MOO_PYTHON=${PYTHONBIN}
 

Index: pkgsrc/editors/medit/distinfo
diff -u pkgsrc/editors/medit/distinfo:1.5 pkgsrc/editors/medit/distinfo:1.6
--- pkgsrc/editors/medit/distinfo:1.5   Tue Nov  3 03:32:18 2015
+++ pkgsrc/editors/medit/distinfo       Sun Apr 11 00:58:16 2021
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.5 2015/11/03 03:32:18 agc Exp $
+$NetBSD: distinfo,v 1.6 2021/04/11 00:58:16 tsutsui Exp $
 
 SHA1 (medit-1.2.0.tar.bz2) = 904ad57f0774ec1ef5ad8905f3dfc700811d5b36
 RMD160 (medit-1.2.0.tar.bz2) = 24c9e9a3df624cbdafaf5251f05690c6a38fe8ad
 SHA512 (medit-1.2.0.tar.bz2) = 936ce5390c7cbc92291946bda08ae271e1d8537686f134d9ac5a9c1067172933c11555a484d7036d7fed8c7fcb57ca145479bcc9009feb44eb3489b6099534f4
 Size (medit-1.2.0.tar.bz2) = 1771094 bytes
 SHA1 (patch-moo_Makefile.in) = 18334afff24bde08a83b670a57745c6317b84e71
+SHA1 (patch-tools_glade2c.py) = 5e7a744f46604a7b4c8be4e45561390c9427286a
+SHA1 (patch-tools_xml2h.py) = 0258456c05c31cf1d209a23abed68097f0451d22

Added files:

Index: pkgsrc/editors/medit/patches/patch-tools_glade2c.py
diff -u /dev/null pkgsrc/editors/medit/patches/patch-tools_glade2c.py:1.1
--- /dev/null   Sun Apr 11 00:58:16 2021
+++ pkgsrc/editors/medit/patches/patch-tools_glade2c.py Sun Apr 11 00:58:16 2021
@@ -0,0 +1,104 @@
+$NetBSD: patch-tools_glade2c.py,v 1.1 2021/04/11 00:58:16 tsutsui Exp $
+
+- mechanical python3 support
+
+--- tools/glade2c.py.orig      2012-12-16 23:55:32.000000000 +0000
++++ tools/glade2c.py
+@@ -5,7 +5,7 @@ import sys
+ import getopt
+ import xml.dom
+ import xml.dom.minidom as minidom
+-import StringIO
++import io
+ 
+ def name_is_nice(name):
+     return name[-1:] not in "0123456789"
+@@ -50,7 +50,7 @@ class GladeXml(object):
+         walk_node(root, False, check_node)
+ 
+     def format_buffer(self):
+-        out = StringIO.StringIO()
++        out = io.StringIO()
+         for l in self.buffer.splitlines():
+             out.write('"')
+             out.write(l.replace('\\', '\\\\').replace('"', '\\"'))
+@@ -208,9 +208,9 @@ G_GNUC_UNUSED static %(XmlStruct)s *
+ }
+ """
+ 
+-    buf = StringIO.StringIO()
++    buf = io.StringIO()
+     if gxml.widgets:
+-        print >> buf, ''
++        print('', file=buf)
+         for w in gxml.widgets:
+             name = w.name
+             ct = params.id_map.get(name)
+@@ -218,11 +218,11 @@ G_GNUC_UNUSED static %(XmlStruct)s *
+                 class_name = w.class_name
+             else:
+                 class_name = ct[0]
+-            print >> buf, '    %s *%s;' % (class_name, name)
++            print('    %s *%s;' % (class_name, name), file=buf)
+     glade_xml_widgets_decl = buf.getvalue()
+     buf.close()
+ 
+-    buf = StringIO.StringIO()
++    buf = io.StringIO()
+     for w in gxml.widgets:
+         name = w.name
+         ct = params.id_map.get(name)
+@@ -230,20 +230,20 @@ G_GNUC_UNUSED static %(XmlStruct)s *
+             class_name = w.class_name
+         else:
+             class_name = ct[0]
+-        print >> buf, """\
++        print("""\
+     xml->%(struct_mem)s = (%(class_name)s*) moo_glade_xml_get_widget (xml->xml, "%(glade_name)s");
+-    g_return_val_if_fail (xml->%(struct_mem)s != NULL, FALSE);""" % { 'struct_mem': w.name, 'glade_name': w.real_name, 'class_name': class_name }
++    g_return_val_if_fail (xml->%(struct_mem)s != NULL, FALSE);""" % { 'struct_mem': w.name, 'glade_name': w.real_name, 'class_name': class_name }, file=buf)
+     glade_xml_widgets_defs = buf.getvalue()
+     buf.close()
+ 
+-    buf = StringIO.StringIO()
++    buf = io.StringIO()
+     for id in params.id_map:
+         ct = params.id_map.get(id)
+         if ct[1]:
+             type_name = ct[1]
+         else:
+             type_name = 'g_type_from_name ("%s")' % (ct[0],)
+-        print >> buf, '    moo_glade_xml_map_id (xml->xml, "%s", %s);' % (id, type_name)
++        print('    moo_glade_xml_map_id (xml->xml, "%s", %s);' % (id, type_name), file=buf)
+     glade_xml_widgets_map = buf.getvalue()
+     buf.close()
+ 
+@@ -300,7 +300,7 @@ def convert_buffer(buf, params, output, 
+ 
+         if output is None:
+             output = sys.stdout
+-        elif isinstance(output, str) or isinstance(output, unicode):
++        elif isinstance(output, str):
+             output = open(output, 'w')
+             close_output = True
+ 
+@@ -317,7 +317,7 @@ def convert_file(filename, params, outpu
+     return ret
+ 
+ def usage():
+-    print "Usage: %s [--map=id,ClassName,CLASS_TYPE...] [--output=outfile] FILE" % (sys.argv[0],)
++    print("Usage: %s [--map=id,ClassName,CLASS_TYPE...] [--output=outfile] FILE" % (sys.argv[0],))
+ 
+ def main(args):
+     params = ConvertParams()
+@@ -325,8 +325,8 @@ def main(args):
+     try:
+         opts, files = getopt.getopt(args[1:], "hm:o:s:S:r:",
+                                     ["help", "map=", "output=", "struct-name=", "StructName=", "root="])
+-    except getopt.GetoptError, err:
+-        print str(err)
++    except getopt.GetoptError as err:
++        print(str(err))
+         usage()
+         return 2
+ 
Index: pkgsrc/editors/medit/patches/patch-tools_xml2h.py
diff -u /dev/null pkgsrc/editors/medit/patches/patch-tools_xml2h.py:1.1
--- /dev/null   Sun Apr 11 00:58:16 2021
+++ pkgsrc/editors/medit/patches/patch-tools_xml2h.py   Sun Apr 11 00:58:16 2021
@@ -0,0 +1,24 @@
+$NetBSD: patch-tools_xml2h.py,v 1.1 2021/04/11 00:58:16 tsutsui Exp $
+
+- mechanical python3 support
+
+--- tools/xml2h.py.orig        2012-12-16 23:55:32.000000000 +0000
++++ tools/xml2h.py
+@@ -11,13 +11,13 @@ tmp_output = output + '.tmp'
+ varname = sys.argv[3]
+ 
+ outfile = open(tmp_output, 'w')
+-print >> outfile, '/* -*- C -*- */'
+-print >> outfile, 'static const char %s [] = ""' % (varname,)
++print('/* -*- C -*- */', file=outfile)
++print('static const char %s [] = ""' % (varname,), file=outfile)
+ for line in open(input):
+     if line.endswith('\n'):
+         line = line[:-1]
+-    print >> outfile, '"' + line.replace('"', '\\"') + '\\n"'
+-print >> outfile, ';'
++    print('"' + line.replace('"', '\\"') + '\\n"', file=outfile)
++print(';', file=outfile)
+ 
+ outfile.close()
+ 



Home | Main Index | Thread Index | Old Index