Lines Matching full:patch

49             # Drop patch fuzz info with header and footer to log file so
51 bb.note("--- Patch fuzz start ---\n%s\n--- Patch fuzz end ---" % format(stdout))
65 return "Patch Error: %s" % self.msg
83 Clean out the patch set. Generally includes unapplying all
88 def Import(self, patch, force): argument
89 if not patch.get("file"):
90 if not patch.get("remote"):
91 raise PatchError("Patch file must be specified in patch import.")
93 patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
96 if not patch.get(param):
97 patch[param] = PatchSet.defaults[param]
99 if patch.get("remote"):
100 patch["file"] = self.d.expand(bb.fetch2.localpath(patch["remote"], self.d))
102 patch["filemd5"] = bb.utils.md5_file(patch["file"])
116 Read a patch file and determine which files it will modify.
118 patchfile: the patch file to read
119 striplevel: the strip level at which the patch is going to be applied
132 bb.error('Patch %s has invalid strip level %d' % (patchfile, striplevel))
191 def _appendPatchFile(self, patch, strippath): argument
193 f.write(os.path.basename(patch) + "," + strippath + "\n")
194 shellcmd = ["cat", patch, ">" , self.patchdir + "/" + os.path.basename(patch)]
198 patch = {}
199 patch['file'] = p.split(",")[0]
200 patch['strippath'] = p.split(",")[1]
201 self._applypatch(patch, False, True)
219 def Import(self, patch, force = None): argument
221 PatchSet.Import(self, patch, force)
227 self.patches.insert(i, patch)
229 def _applypatch(self, patch, force = False, reverse = False, run = True): argument
230 …shellcmd = ["cat", patch['file'], "|", "patch", "--no-backup-if-mismatch", "-p", patch['strippath'…
250 (os.path.basename(patch['file']), err.output))
253 self._appendPatchFile(patch['file'], patch['strippath'])
262 bb.note("applying patch %s" % i)
271 bb.note("applying patch %s" % self.patches[next])
295 patch_line_prefix = '%% original patch'
324 Extract just the header lines from the top of a patch file
362 # Remove any [PATCH][oe-core] etc.
418 Prepare a git commit command line based on the header from a patch file
422 # Process patch header and extract useful information
467 … shellcmd = ["git", "format-patch", "--no-signature", "--no-numbered", startcommit, "-o", tempdir]
500 def _applypatch(self, patch, force = False, reverse = False, run = True): argument
503 def _applypatchhelper(shellcmd, patch, force = False, reverse = False, run = True): argument
507 shellcmd.append(patch['file'])
514 # Add hooks which add a pointer to the original patch file name in the commit message
534 patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file'])
538 shellcmd += ["am", "-3", "--keep-cr", "--no-scissors", "-p%s" % patch['strippath']]
539 return _applypatchhelper(shellcmd, patch, force, reverse, run)
555 shellcmd = ["git", "--git-dir=%s" % reporoot, "apply", "-p%s" % patch['strippath']]
557 output = _applypatchhelper(shellcmd, patch, force, reverse, run)
559 # Fall back to patch
560 output = PatchTree._applypatch(self, patch, force, reverse, run)
568 … (tmpfile, shellcmd) = self.prepareCommit(patch['file'], self.commituser, self.commitemail)
617 patch = {}
619 patch["quiltfile"] = self._quiltpatchpath(parts[0])
620 patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])
622 patch["strippath"] = parts[1][2:]
623 self.patches.append(patch)
635 for patch in self.patches:
636 if os.path.basename(patch["quiltfile"]) == output[-1]:
637 self._current = self.patches.index(patch)
640 def Import(self, patch, force = None): argument
643 PatchSet.Import(self, patch, force)
644 oe.path.symlink(patch["file"], self._quiltpatchpath(patch["file"]), force=True)
646 f.write(os.path.basename(patch["file"]) + " -p" + patch["strippath"] + "\n")
647 patch["quiltfile"] = self._quiltpatchpath(patch["file"])
648 patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])
654 self.patches.insert(self._current or 0, patch)
693 patch = self.patches[kwargs["patch"]]
694 if not patch:
695 raise PatchError("No patch found at index %s in patchset." % kwargs["patch"])
696 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(patch["remote"])
699 if not patch.get("file") and patch.get("remote"):
700 patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
702 shutil.copyfile(patch["quiltfile"], patch["file"])
704 …ote refresh of %s, unsupported remote url scheme %s." % (os.path.basename(patch["quiltfile"]), typ…
710 elif kwargs.get("patch"):
711 args.append(os.path.basename(self.patches[kwargs["patch"]]["quiltfile"]))
742 # Patch resolver which relies on the user doing all the work involved in the
743 # resolution, with the exception of refreshing the remote copy of the patch
758 # Patch application failed
768 f.write("echo '*** Manual patch resolution mode ***'\n")
769 f.write("echo 'Dropping to a shell, so patch rejects can be fixed manually.'\n")
770 … f.write("echo 'Run \"quilt refresh\" when patch is corrected, press CTRL+D to exit.'\n")
775 …self.terminal("bash --rcfile " + rcfile, 'Patch Rejects: Please fix patch rejects manually', self.…
783 for patch in self.patchset.patches:
786 if opatch["quiltfile"] == patch["quiltfile"]:
790 patch["remote"] = oldpatch["remote"]
791 if patch["quiltfile"] == oldpatch["quiltfile"]:
792 if patch["quiltfilemd5"] != oldpatch["quiltfilemd5"]:
793 …bb.note("Patch %s has changed, updating remote url %s" % (os.path.basename(patch["quiltfile"]), pa…
795 … self.patchset.Refresh(remote=True, patch=self.patchset.patches.index(patch))
798 … raise PatchError("Patch application failed, and user did not fix and refresh the patch.")
806 """Return the local path of a patch, or return nothing if this isn't a patch"""
822 elif ext not in (".diff", ".patch"):
847 bb.note("Patch %s %s" % (patchname, reason))