summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/combo-layer16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 8f57ba58cf..b90bfc8800 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -482,32 +482,32 @@ def check_repo_clean(repodir):
482 sys.exit(1) 482 sys.exit(1)
483 483
484def check_patch(patchfile): 484def check_patch(patchfile):
485 f = open(patchfile) 485 f = open(patchfile, 'rb')
486 ln = f.readline() 486 ln = f.readline()
487 of = None 487 of = None
488 in_patch = False 488 in_patch = False
489 beyond_msg = False 489 beyond_msg = False
490 pre_buf = '' 490 pre_buf = b''
491 while ln: 491 while ln:
492 if not beyond_msg: 492 if not beyond_msg:
493 if ln == '---\n': 493 if ln == b'---\n':
494 if not of: 494 if not of:
495 break 495 break
496 in_patch = False 496 in_patch = False
497 beyond_msg = True 497 beyond_msg = True
498 elif ln.startswith('--- '): 498 elif ln.startswith(b'--- '):
499 # We have a diff in the commit message 499 # We have a diff in the commit message
500 in_patch = True 500 in_patch = True
501 if not of: 501 if not of:
502 print('WARNING: %s contains a diff in its commit message, indenting to avoid failure during apply' % patchfile) 502 print('WARNING: %s contains a diff in its commit message, indenting to avoid failure during apply' % patchfile)
503 of = open(patchfile + '.tmp', 'w') 503 of = open(patchfile + '.tmp', 'wb')
504 of.write(pre_buf) 504 of.write(pre_buf)
505 pre_buf = '' 505 pre_buf = b''
506 elif in_patch and not ln[0] in '+-@ \n\r': 506 elif in_patch and not ln[0] in b'+-@ \n\r':
507 in_patch = False 507 in_patch = False
508 if of: 508 if of:
509 if in_patch: 509 if in_patch:
510 of.write(' ' + ln) 510 of.write(b' ' + ln)
511 else: 511 else:
512 of.write(ln) 512 of.write(ln)
513 else: 513 else: