diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-09-22 17:21:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-23 09:53:13 +0100 |
commit | e0b9a96002bb23e7c2c8a8c9c4d2431461fd6cb7 (patch) | |
tree | b554f7d50f4887da9c73cc33c3bd6aa2bb8f89a3 /meta/lib | |
parent | 8fb70c6e7a1203c0b18938d5d851a91a5d27c2e3 (diff) | |
download | poky-e0b9a96002bb23e7c2c8a8c9c4d2431461fd6cb7.tar.gz |
lib/oe/patch: fix for git am not cleaning up after itself
Unfortunately it appears that under certain circumstances, a failed
git am followed by git am --abort won't clean up any changes the patch
might have made - this was seen when running "devtool extract" on the
unzip recipe; unzip-6.0_overflow3.diff has a malformed date as far as
git am is concerned but it triggers this condition. Add a
git reset --hard HEAD followed by git clean -f in order to recover from
this scenario.
(From OE-Core rev: 21fdbd76f458b70a6646dd6d0749e3a465ebd320)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/patch.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 108bf1de56..7441214006 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py | |||
@@ -407,6 +407,13 @@ class GitApplyTree(PatchTree): | |||
407 | runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) | 407 | runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) |
408 | except CmdError: | 408 | except CmdError: |
409 | pass | 409 | pass |
410 | # git am won't always clean up after itself, sadly, so... | ||
411 | shellcmd = ["git", "--work-tree=%s" % reporoot, "reset", "--hard", "HEAD"] | ||
412 | runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) | ||
413 | # Also need to take care of any stray untracked files | ||
414 | shellcmd = ["git", "--work-tree=%s" % reporoot, "clean", "-f"] | ||
415 | runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) | ||
416 | |||
410 | # Fall back to git apply | 417 | # Fall back to git apply |
411 | shellcmd = ["git", "--git-dir=%s" % reporoot, "apply", "-p%s" % patch['strippath']] | 418 | shellcmd = ["git", "--git-dir=%s" % reporoot, "apply", "-p%s" % patch['strippath']] |
412 | try: | 419 | try: |