1 |
commit: 32dfd7499ed52070388283df91257bfef02abffb |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 10 14:20:33 2018 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 10 14:20:33 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32dfd749 |
7 |
|
8 |
dev-util/imediff2: Revbump to fix errors in python 3 patch |
9 |
|
10 |
Package-Manager: Portage-2.3.41, Repoman-2.3.9 |
11 |
|
12 |
dev-util/imediff2/files/1.1.2-python-3.patch | 68 +++++++++++++++++----- |
13 |
...f2-1.1.2-r4.ebuild => imediff2-1.1.2-r5.ebuild} | 0 |
14 |
2 files changed, 55 insertions(+), 13 deletions(-) |
15 |
|
16 |
diff --git a/dev-util/imediff2/files/1.1.2-python-3.patch b/dev-util/imediff2/files/1.1.2-python-3.patch |
17 |
index a7b4fadf4d6..811f4158312 100644 |
18 |
--- a/dev-util/imediff2/files/1.1.2-python-3.patch |
19 |
+++ b/dev-util/imediff2/files/1.1.2-python-3.patch |
20 |
@@ -1,6 +1,6 @@ |
21 |
--- a/imediff2 2017-11-14 09:28:57.007929569 -0500 |
22 |
+++ b/imediff2 2017-11-14 10:11:12.618496692 -0500 |
23 |
-@@ -18,10 +18,12 @@ |
24 |
+@@ -18,20 +18,20 @@ |
25 |
# License along with the program; if not, write to the Free Software |
26 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 |
|
28 |
@@ -15,7 +15,9 @@ |
29 |
import curses |
30 |
import tempfile |
31 |
import gettext |
32 |
-@@ -31,7 +33,6 @@ |
33 |
+ import difflib |
34 |
+ import getopt |
35 |
+-import string |
36 |
import types |
37 |
import time |
38 |
import pty |
39 |
@@ -35,11 +37,11 @@ |
40 |
- except IOError, (error, message): |
41 |
- if error == errno.ENOENT and assume_empty: |
42 |
+ except IOError as e: |
43 |
-+ if e.error == errno.ENOENT and assume_empty: |
44 |
++ if e.errno == errno.ENOENT and assume_empty: |
45 |
return "" |
46 |
else: |
47 |
- sys.stderr.write(_("Could not read '%s': %s\n") % (filename, message)) |
48 |
-+ sys.stderr.write(_("Could not read '%s': %s\n") % (filename, e.message)) |
49 |
++ sys.stderr.write(_("Could not read '%s': %s\n") % (filename, e.strerror)) |
50 |
sys.exit(3) |
51 |
|
52 |
def strip_end_lines( txt ): |
53 |
@@ -57,6 +59,27 @@ |
54 |
decor, color_pair] ) |
55 |
j+=1 |
56 |
|
57 |
+@@ -287,9 +287,9 @@ |
58 |
+ def sel_next( dir ): |
59 |
+ global sel, active_chunks |
60 |
+ if dir == 'up': |
61 |
+- rng = range(sel-1, -1, -1) |
62 |
++ rng = list(range(sel-1, -1, -1)) |
63 |
+ else: |
64 |
+- rng = range(sel+1, len(active_chunks)) |
65 |
++ rng = list(range(sel+1, len(active_chunks))) |
66 |
+ for j in rng: |
67 |
+ if active_chunks[j][1] > y and active_chunks[j][0] < y+winh: |
68 |
+ sel = j |
69 |
+@@ -442,7 +441,7 @@ |
70 |
+ elif c == ord('h') or c == ord('?') or c == curses.KEY_HELP: |
71 |
+ helpw = 0 |
72 |
+ helph = 0 |
73 |
+- for l in string.split(helptext(), "%c"%10): |
74 |
++ for l in helptext().split("%c"%10): |
75 |
+ helpw = max(helpw, len(l)) |
76 |
+ helph += 1 |
77 |
+ helppad = curses.newpad(helph+2, helpw+2) |
78 |
@@ -512,21 +513,21 @@ |
79 |
try: |
80 |
opts, args = getopt.getopt(sys.argv[1:], "hmuo:abcNV", |
81 |
@@ -65,26 +88,44 @@ |
82 |
- print _("Error: ") + str(e) |
83 |
- print usagetext() |
84 |
+except getopt.GetoptError as e: |
85 |
-+ print(_("Error: ") + str(e)) |
86 |
-+ print(usagetext()) |
87 |
++ print((_("Error: ") + str(e))) |
88 |
++ print((usagetext())) |
89 |
sys.exit(2) |
90 |
|
91 |
for o, a in opts: |
92 |
if o in ("-h", "--help"): |
93 |
- print usagetext() |
94 |
-+ print(usagetext()) |
95 |
++ print((usagetext())) |
96 |
sys.exit() |
97 |
elif o in ("-V", "--version"): |
98 |
- print "%s %s" % (PACKAGE, VERSION) |
99 |
-+ print("%s %s" % (PACKAGE, VERSION)) |
100 |
++ print(("%s %s" % (PACKAGE, VERSION))) |
101 |
sys.exit() |
102 |
|
103 |
if len(args)<2: |
104 |
- print usagetext() |
105 |
-+ print(usagetext()) |
106 |
++ print((usagetext())) |
107 |
sys.exit(2) |
108 |
|
109 |
for o, a in opts: |
110 |
+@@ -592,15 +592,15 @@ |
111 |
+ if launch_editor: |
112 |
+ assert( not editor is None ) |
113 |
+ try: |
114 |
+ (of, of_name) = tempfile.mkstemp(prefix='imediff2') |
115 |
+- os.write( of, output ) |
116 |
++ os.write( of, output.encode() ) |
117 |
+ os.close(of) |
118 |
+ time.sleep(0.1) # make the change visible - many editor look a lot like imediff2 |
119 |
+ editor_ret = os.system('%s %s' % (editor, of_name)) |
120 |
+ time.sleep(0.1) |
121 |
+ if editor_ret == 0: |
122 |
+ new_b_lines = read_lines(of_name) |
123 |
+- if string.join(new_b_lines, '') == output: |
124 |
++ if ''.join(new_b_lines) == output: |
125 |
+ chunk_mode = 'old' |
126 |
+ elif new_b_lines != lines_a: |
127 |
+ lines_b = new_b_lines |
128 |
@@ -607,8 +608,8 @@ |
129 |
else: |
130 |
chunks = 'old' |
131 |
@@ -92,7 +133,7 @@ |
132 |
- except IOError, (error, message): |
133 |
- sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, message)); |
134 |
+ except IOError as e: |
135 |
-+ sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, e.message)); |
136 |
++ sys.stderr.write(_("Could not write to '%s': %s\n") % (of_name, e.strerror)); |
137 |
|
138 |
if not launch_editor: |
139 |
break |
140 |
@@ -101,13 +142,14 @@ |
141 |
try: |
142 |
if ofile is not None: |
143 |
- of = file(ofile, 'wb') |
144 |
-+ of = open(ofile, 'w') |
145 |
- of.write( output ) |
146 |
++ of = open(ofile, 'wb') |
147 |
+- of.write( output ) |
148 |
++ of.write( output.encode() ) |
149 |
of.close() |
150 |
sys.exit(0) |
151 |
- except IOError, (error, message): |
152 |
- sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, message)); |
153 |
+ except IOError as e: |
154 |
-+ sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, e.message)); |
155 |
++ sys.stderr.write(_("Could not write to '%s': %s\n") % (ofile, e.strerror)); |
156 |
|
157 |
sys.exit(3) |
158 |
|
159 |
diff --git a/dev-util/imediff2/imediff2-1.1.2-r4.ebuild b/dev-util/imediff2/imediff2-1.1.2-r5.ebuild |
160 |
similarity index 100% |
161 |
rename from dev-util/imediff2/imediff2-1.1.2-r4.ebuild |
162 |
rename to dev-util/imediff2/imediff2-1.1.2-r5.ebuild |