public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/imediff2/files/, dev-util/imediff2/
@ 2018-07-10 14:21 Brian Evans
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Evans @ 2018-07-10 14:21 UTC (permalink / raw
  To: gentoo-commits

commit:     32dfd7499ed52070388283df91257bfef02abffb
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 10 14:20:33 2018 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Tue Jul 10 14:20:33 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32dfd749

dev-util/imediff2: Revbump to fix errors in python 3 patch

Package-Manager: Portage-2.3.41, Repoman-2.3.9

 dev-util/imediff2/files/1.1.2-python-3.patch       | 68 +++++++++++++++++-----
 ...f2-1.1.2-r4.ebuild => imediff2-1.1.2-r5.ebuild} |  0
 2 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/dev-util/imediff2/files/1.1.2-python-3.patch b/dev-util/imediff2/files/1.1.2-python-3.patch
index a7b4fadf4d6..811f4158312 100644
--- a/dev-util/imediff2/files/1.1.2-python-3.patch
+++ b/dev-util/imediff2/files/1.1.2-python-3.patch
@@ -1,6 +1,6 @@
 --- a/imediff2	2017-11-14 09:28:57.007929569 -0500
 +++ b/imediff2	2017-11-14 10:11:12.618496692 -0500
-@@ -18,10 +18,12 @@
+@@ -18,20 +18,20 @@
  # License along with the program; if not, write to the Free Software
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
@@ -15,7 +15,9 @@
  import curses
  import tempfile
  import gettext
-@@ -31,7 +33,6 @@
+ import difflib
+ import getopt
+-import string
  import types
  import time
  import pty
@@ -35,11 +37,11 @@
 -  except IOError, (error, message):
 -    if error == errno.ENOENT and assume_empty:
 +  except IOError as e:
-+    if e.error == errno.ENOENT and assume_empty:
++    if e.errno == errno.ENOENT and assume_empty:
        return ""
      else:
 -      sys.stderr.write(_("Could not read '%s': %s\n") % (filename, message))
-+      sys.stderr.write(_("Could not read '%s': %s\n") % (filename, e.message))
++      sys.stderr.write(_("Could not read '%s': %s\n") % (filename, e.strerror))
        sys.exit(3)
  
  def strip_end_lines( txt ):
@@ -57,6 +59,27 @@
            decor, color_pair] )
          j+=1
  
+@@ -287,9 +287,9 @@
+   def sel_next( dir ):
+     global sel, active_chunks
+     if dir == 'up':
+-      rng = range(sel-1, -1, -1)
++      rng = list(range(sel-1, -1, -1))
+     else:
+-      rng = range(sel+1, len(active_chunks))
++      rng = list(range(sel+1, len(active_chunks)))
+     for j in rng:
+       if active_chunks[j][1] > y and active_chunks[j][0] < y+winh:
+         sel = j
+@@ -442,7 +441,7 @@
+     elif c == ord('h') or c == ord('?') or c == curses.KEY_HELP:
+       helpw = 0
+       helph = 0
+-      for l in string.split(helptext(), "%c"%10):
++      for l in helptext().split("%c"%10):
+         helpw = max(helpw, len(l))
+         helph += 1
+       helppad = curses.newpad(helph+2, helpw+2)
 @@ -512,21 +513,21 @@
  try:
    opts, args = getopt.getopt(sys.argv[1:], "hmuo:abcNV",
@@ -65,26 +88,44 @@
 -  print _("Error: ") + str(e)
 -  print usagetext()
 +except getopt.GetoptError as e:
-+  print(_("Error: ") + str(e))
-+  print(usagetext())
++  print((_("Error: ") + str(e)))
++  print((usagetext()))
    sys.exit(2)
  
  for o, a in opts:
    if o in ("-h", "--help"):
 -    print usagetext()
-+    print(usagetext())
++    print((usagetext()))
      sys.exit()
    elif o in ("-V", "--version"):
 -    print "%s %s" % (PACKAGE, VERSION)
-+    print("%s %s" % (PACKAGE, VERSION))
++    print(("%s %s" % (PACKAGE, VERSION)))
      sys.exit()
  
  if len(args)<2:
 -  print usagetext()
-+  print(usagetext())
++  print((usagetext()))
    sys.exit(2)
  
  for o, a in opts:
+@@ -592,15 +592,15 @@
+   if launch_editor:
+     assert( not editor is None )
+     try:
+       (of, of_name) = tempfile.mkstemp(prefix='imediff2')
+-      os.write( of, output )
++      os.write( of, output.encode() )
+       os.close(of)
+       time.sleep(0.1) # make the change visible - many editor look a lot like imediff2
+       editor_ret = os.system('%s %s' % (editor, of_name))
+       time.sleep(0.1)
+       if editor_ret == 0:
+         new_b_lines = read_lines(of_name)
+-        if string.join(new_b_lines, '') == output:
++        if ''.join(new_b_lines) == output:
+           chunk_mode = 'old'
+         elif new_b_lines != lines_a:
+           lines_b = new_b_lines
 @@ -607,8 +608,8 @@
          else:
            chunks = 'old'
@@ -92,7 +133,7 @@
 -    except IOError, (error, message):
 -      sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, message));
 +    except IOError as e:
-+      sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, e.message));
++      sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, e.strerror));
  
    if not launch_editor:
      break
@@ -101,13 +142,14 @@
    try:
      if ofile is not None:
 -      of = file(ofile, 'wb')
-+      of = open(ofile, 'w')
-       of.write( output )
++      of = open(ofile, 'wb')
+-      of.write( output )
++      of.write( output.encode() )
        of.close()
      sys.exit(0)
 -  except IOError, (error, message):
 -    sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, message));
 +  except IOError as e:
-+    sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, e.message));
++    sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, e.strerror));
  
  sys.exit(3)

diff --git a/dev-util/imediff2/imediff2-1.1.2-r4.ebuild b/dev-util/imediff2/imediff2-1.1.2-r5.ebuild
similarity index 100%
rename from dev-util/imediff2/imediff2-1.1.2-r4.ebuild
rename to dev-util/imediff2/imediff2-1.1.2-r5.ebuild


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/imediff2/files/, dev-util/imediff2/
@ 2021-03-10 20:32 Brian Evans
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Evans @ 2021-03-10 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     b128eb024fca796802c6b47f7ca4addbb3c9b7f8
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 10 20:31:49 2021 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Wed Mar 10 20:31:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b128eb02

dev-util/imediff2: Version bump for 1.1.2.1

Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-util/imediff2/Manifest                     |   1 +
 dev-util/imediff2/files/1.1.2.1-python-3.patch | 157 +++++++++++++++++++++++++
 dev-util/imediff2/imediff2-1.1.2.1.ebuild      |  40 +++++++
 3 files changed, 198 insertions(+)

diff --git a/dev-util/imediff2/Manifest b/dev-util/imediff2/Manifest
index ec5ecf74b82..f550529bdba 100644
--- a/dev-util/imediff2/Manifest
+++ b/dev-util/imediff2/Manifest
@@ -1 +1,2 @@
+DIST imediff2_1.1.2.1.orig.tar.gz 20393 BLAKE2B 560eef8600bac8ad302907563bd8520ef7881009c8a35c74427d0d5d9e8d4303446f1eb39c01fec201c798f286023765776a84b1e1aaa9e2d585a45870375f16 SHA512 ad0e22f5f2f16efb976a0d6d16c34798cc8aace4251a99cb7764df6841f93c2a6bb9dc8cbb59d8f3ae5a5ad7c161a05b9c3c7b36cc7bdf98eac3ef3b735ef6c4
 DIST imediff2_1.1.2.orig.tar.gz 17974 BLAKE2B f83b6ab652b1dd044587e75e4e7551a8132e1860b14f0d85d37f35383bd161a672860162e93554cf4db844d6a4700fa1876a30874c50fcb8442b4190a9b19185 SHA512 54d196d67107283bc3339eba30acb1c60972f256a268e86da397e0bdafa05220facc7979638a6a917b0c2dc7171edc3aa6b188295c9f40e9debf87a63731e748

diff --git a/dev-util/imediff2/files/1.1.2.1-python-3.patch b/dev-util/imediff2/files/1.1.2.1-python-3.patch
new file mode 100644
index 00000000000..aa26ad7f9db
--- /dev/null
+++ b/dev-util/imediff2/files/1.1.2.1-python-3.patch
@@ -0,0 +1,157 @@
+diff -aurN a/imediff2 b/imediff2
+--- a/imediff2	2018-10-20 13:36:19.000000000 -0400
++++ b/imediff2	2021-03-03 10:03:31.121774492 -0500
+@@ -167,19 +167,19 @@
+ def read_lines( filename ):
+   global assume_empty
+   try:
+-    fp = file( filename )
++    fp = open( filename )
+     l = fp.readlines()
+     fp.close()
+     return l
+-  except IOError, (error, message):
+-    if error == errno.ENOENT and assume_empty:
++  except IOError as e:
++    if e.errno == errno.ENOENT and assume_empty:
+       return ""
+     else:
+-      sys.stderr.write(_("Could not read '%s': %s\n") % (filename, message))
++      sys.stderr.write(_("Could not read '%s': %s\n") % (filename, e.strerror))
+       sys.exit(3)
+ 
+ def strip_end_lines( txt ):
+-  return string.replace(string.replace(txt,"%c"%10,""),"%c"%13,"")
++  return txt.replace("%c"%10,"").replace("%c"%13,"")
+ 
+ def main(stdscr, lines_a, lines_b, start_mode):
+   global sel, active_chunks, x,y, lines, textpad, contw,conth
+@@ -283,7 +283,7 @@
+         active_chunks.append( [j, j+len(line_list), i] )
+ 
+       for l in line_list:
+-        lines.append( [string.expandtabs(strip_end_lines(l)),
++        lines.append( [strip_end_lines(l).expandtabs(),
+           decor, color_pair] )
+         j+=1
+ 
+@@ -332,9 +332,9 @@
+   def sel_next( dir ):
+     global sel, active_chunks
+     if dir == 'up':
+-      rng = range(sel-1, -1, -1)
++      rng = list(range(sel-1, -1, -1))
+     else:
+-      rng = range(sel+1, len(active_chunks))
++      rng = list(range(sel+1, len(active_chunks)))
+     for j in rng:
+       if active_chunks[j][1] > y and active_chunks[j][0] < y+winh:
+         sel = j
+@@ -487,7 +487,7 @@
+     elif c == ord('h') or c == ord('?') or c == curses.KEY_HELP:
+       helpw = 0
+       helph = 0
+-      for l in string.split(helptext(), "%c"%10):
++      for l in helptext().split("%c"%10):
+         helpw = max(helpw, len(l))
+         helph += 1
+       helppad = curses.newpad(helph+2, helpw+2)
+@@ -502,7 +502,7 @@
+     elif c == ord('q') or c == curses.KEY_CANCEL:
+       quitw = 0
+       quith = 0
+-      for l in string.split(quittext(), "%c"%10):
++      for l in quittext().split("%c"%10):
+         quitw = max(quitw, len(l))
+         quith += 1
+       quitpad = curses.newpad(quith+2, quitw+2)
+@@ -571,33 +571,33 @@
+ try:
+   opts, args = getopt.getopt(sys.argv[1:], "hmuo:abcNtV",
+     ["help","mono","unresolved","output=", "template", "version", "new-file"])
+-except getopt.GetoptError, e:
+-  print _("Error: ") + str(e)
+-  print usagetext()
++except getopt.GetoptError as e:
++  print((_("Error: ") + str(e)))
++  print(usagetext())
+   sys.exit(2)
+ 
+ for o, a in opts:
+   if o in ("-h", "--help"):
+-    print usagetext()
++    print((usagetext()))
+     sys.exit()
+   elif o in ("-t", "--template"):
+     try:
+       with open(config_file, 'w') as f:
+-        print >>f, "# Configuration for imediff2: (Erase this file to reset)"
+-        print >>f, "# <command_key_in_action> <command_key_in_manpage>"
+-        print >>f, "# edit only first character of each line to 'a'...'z'"
+-        print >>f, "#"
++        print(("# Configuration for imediff2: (Erase this file to reset)"), file=f)
++        print(("# <command_key_in_action> <command_key_in_manpage>"), file=f)
++        print(("# edit only first character of each line to 'a'...'z'"), file=f)
++        print(("#"), file=f)
+         for k in kcvalues:
+-          print >>f, "%s %s" % (k , k)
++          print(("%s %s" % (k , k)), file=f)
+     except:
+-      print "%s not writable, aborting" % config_file
++      print(("%s not writable, aborting" % config_file))
+     sys.exit()
+   elif o in ("-V", "--version"):
+-    print "%s %s" % (PACKAGE, VERSION)
++    print(("%s %s" % (PACKAGE, VERSION)))
+     sys.exit()
+ 
+ if len(args)<2:
+-  print usagetext()
++  print((usagetext()))
+   sys.exit(2)
+ 
+ for o, a in opts:
+@@ -692,14 +695,14 @@
+     assert( not editor is None )
+     try:
+       (of, of_name) = tempfile.mkstemp(prefix='imediff2')
+-      os.write( of, output )
++      os.write( of, output.encode() )
+       os.close(of)
+       time.sleep(0.1) # make the change visible - many editor look a lot like imediff2
+       editor_ret = os.system('%s %s' % (editor, of_name))
+       time.sleep(0.1)
+       if editor_ret == 0:
+         new_b_lines = read_lines(of_name)
+-        if string.join(new_b_lines, '') == output:
++        if ''.join(new_b_lines) == output:
+           chunk_mode = 'old'
+         elif new_b_lines != lines_a:
+           lines_b = new_b_lines
+@@ -707,8 +710,8 @@
+         else:
+           chunks = 'old'
+       os.unlink(of_name)
+-    except IOError, (error, message):
+-      sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, message));
++    except IOError as e:
++      sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, e.strerror));
+ 
+   if not launch_editor:
+     break
+@@ -719,11 +722,11 @@
+ else:
+   try:
+     if ofile is not None:
+-      of = file(ofile, 'wb')
+-      of.write( output )
++      of = open(ofile, 'wb')
++      of.write( output.encode() )
+       of.close()
+     sys.exit(0)
+-  except IOError, (error, message):
+-    sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, message));
++  except IOError as e:
++    sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, e.strerror));
+ 
+ sys.exit(3)

diff --git a/dev-util/imediff2/imediff2-1.1.2.1.ebuild b/dev-util/imediff2/imediff2-1.1.2.1.ebuild
new file mode 100644
index 00000000000..464fc4d97d2
--- /dev/null
+++ b/dev-util/imediff2/imediff2-1.1.2.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_REQ_USE="ncurses"
+
+inherit python-single-r1
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="An interactive, user friendly 2-way merge tool in text mode"
+HOMEPAGE="https://elonen.iki.fi/code/imediff/"
+SRC_URI="mirror://debian/pool/main/i/${PN}/${MY_P}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND="${PYTHON_DEPS}"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+#S="${WORKDIR}/${PN}"
+
+PATCHES=( "${FILESDIR}/${PV}-python-3.patch" )
+
+src_compile() {
+	# Otherwise the docs get regenerated :)
+	:
+}
+
+src_install() {
+	python_doscript imediff2
+	dobin git-ime
+	dodoc AUTHORS README.md
+	doman imediff2.1 git-ime.1
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-10 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10 20:32 [gentoo-commits] repo/gentoo:master commit in: dev-util/imediff2/files/, dev-util/imediff2/ Brian Evans
  -- strict thread matches above, loose matches on Subject: below --
2018-07-10 14:21 Brian Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox