diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-12-08 00:38:17 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-12-08 00:38:17 +0300 |
commit | 8d6ae7f2a817751fad151168fa10ce28ee0869d8 (patch) | |
tree | 281032f7ec07c41589aa094bd165cc2a98f2d3a7 /poky/meta/lib/oe/patch.py | |
parent | c16fb8893b19075db4bcf3b5bf33c1db8c3ca2bd (diff) | |
parent | 5da3c2284560a7e08ffafd03c5b5ba44a3242228 (diff) | |
download | openbmc-8d6ae7f2a817751fad151168fa10ce28ee0869d8.tar.xz |
Merge tag '0.26' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'poky/meta/lib/oe/patch.py')
-rw-r--r-- | poky/meta/lib/oe/patch.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/poky/meta/lib/oe/patch.py b/poky/meta/lib/oe/patch.py index 2b1eee100..40755fbb0 100644 --- a/poky/meta/lib/oe/patch.py +++ b/poky/meta/lib/oe/patch.py @@ -41,7 +41,7 @@ def runcmd(args, dir = None): (exitstatus, output) = subprocess.getstatusoutput(cmd) if exitstatus != 0: raise CmdError(cmd, exitstatus >> 8, output) - if " fuzz " in output: + if " fuzz " in output and "Hunk " in output: # Drop patch fuzz info with header and footer to log file so # insane.bbclass can handle to throw error/warning bb.note("--- Patch fuzz start ---\n%s\n--- Patch fuzz end ---" % format(output)) @@ -416,7 +416,7 @@ class GitApplyTree(PatchTree): date = newdate if not subject: subject = newsubject - if subject and outlines and not outlines[0].strip() == subject: + if subject and not (outlines and outlines[0].strip() == subject): outlines.insert(0, '%s\n\n' % subject.strip()) # Write out commit message to a file @@ -439,7 +439,6 @@ class GitApplyTree(PatchTree): def extractPatches(tree, startcommit, outdir, paths=None): import tempfile import shutil - import re tempdir = tempfile.mkdtemp(prefix='oepatch') try: shellcmd = ["git", "format-patch", "--no-signature", "--no-numbered", startcommit, "-o", tempdir] @@ -455,13 +454,10 @@ class GitApplyTree(PatchTree): try: with open(srcfile, 'r', encoding=encoding) as f: for line in f: - checkline = line - if checkline.startswith('Subject: '): - checkline = re.sub(r'\[.+?\]\s*', '', checkline[9:]) - if checkline.startswith(GitApplyTree.patch_line_prefix): + if line.startswith(GitApplyTree.patch_line_prefix): outfile = line.split()[-1].strip() continue - if checkline.startswith(GitApplyTree.ignore_commit_prefix): + if line.startswith(GitApplyTree.ignore_commit_prefix): continue patchlines.append(line) except UnicodeDecodeError: @@ -508,8 +504,7 @@ class GitApplyTree(PatchTree): with open(commithook, 'w') as f: # NOTE: the formatting here is significant; if you change it you'll also need to # change other places which read it back - f.write('echo >> $1\n') - f.write('echo "%s: $PATCHFILE" >> $1\n' % GitApplyTree.patch_line_prefix) + f.write('echo "\n%s: $PATCHFILE" >> $1' % GitApplyTree.patch_line_prefix) os.chmod(commithook, 0o755) shutil.copy2(commithook, applyhook) try: |