Show More
@@ -191,18 +191,22 b' def readgitpatch(patchname):' | |||
|
191 | 191 | def dogitpatch(patchname, gitpatches, cwd=None): |
|
192 | 192 | """Preprocess git patch so that vanilla patch can handle it""" |
|
193 | 193 | def extractbin(fp): |
|
194 | line = fp.readline() | |
|
194 | line = fp.readline().rstrip() | |
|
195 | 195 | while line and not line.startswith('literal '): |
|
196 | line = fp.readline() | |
|
196 | line = fp.readline().rstrip() | |
|
197 | 197 | if not line: |
|
198 | 198 | return |
|
199 |
size = int(line[8:] |
|
|
199 | size = int(line[8:]) | |
|
200 | 200 | dec = [] |
|
201 | line = fp.readline() | |
|
201 | line = fp.readline().rstrip() | |
|
202 | 202 | while line: |
|
203 |
l |
|
|
204 | dec.append(base85.b85decode(line)) | |
|
205 | line = fp.readline() | |
|
203 | l = line[0] | |
|
204 | if l <= 'Z' and l >= 'A': | |
|
205 | l = ord(l) - ord('A') + 1 | |
|
206 | else: | |
|
207 | l = ord(l) - ord('a') + 27 | |
|
208 | dec.append(base85.b85decode(line[1:])[:l]) | |
|
209 | line = fp.readline().rstrip() | |
|
206 | 210 | text = zlib.decompress(''.join(dec)) |
|
207 | 211 | if len(text) != size: |
|
208 | 212 | raise util.Abort(_('binary patch is %d bytes, not %d') % |
General Comments 0
You need to be logged in to leave comments.
Login now