public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 06/15] lib/oe/patch.py: abort "git am" if it fails
Date: Fri, 19 Dec 2014 11:41:48 +0000	[thread overview]
Message-ID: <c202c0a55897c061b5ccb8d581d5abe8997d1b4e.1418984743.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1418984743.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1418984743.git.paul.eggleton@linux.intel.com>

If we don't do this, you may still be in the git am resolution mode at
the end of applying patches, which is not desirable.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/patch.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 2bf3065..5227781 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -290,6 +290,12 @@ class GitApplyTree(PatchTree):
             shellcmd = ["git", "--work-tree=.", "am", "-3", "--keep-cr", "-p%s" % patch['strippath']]
             return _applypatchhelper(shellcmd, patch, force, reverse, run)
         except CmdError:
+            # Need to abort the git am, or we'll still be within it at the end
+            try:
+                shellcmd = ["git", "--work-tree=.", "am", "--abort"]
+                runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+            except CmdError:
+                pass
             # Fall back to git apply
             shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']]
             try:
-- 
1.9.3



  parent reply	other threads:[~2014-12-19 11:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19 11:41 [PATCH 00/15] Developer workflow tools Paul Eggleton
2014-12-19 11:41 ` [PATCH 01/15] meta-environment: don't mark tasks as nostamp Paul Eggleton
2014-12-19 11:41 ` [PATCH 02/15] classes/package: move read_shlib_providers() to a common unit Paul Eggleton
2014-12-19 11:41 ` [PATCH 03/15] lib/oe/patch: fall back to patch if git apply fails Paul Eggleton
2014-12-19 11:41 ` [PATCH 04/15] lib/oe/patch: auto-commit when falling back from git am Paul Eggleton
2014-12-19 11:41 ` [PATCH 05/15] lib/oe/patch: use --keep-cr with " Paul Eggleton
2014-12-19 11:41 ` Paul Eggleton [this message]
2014-12-19 11:41 ` [PATCH 07/15] lib/oe/patch: add support for extracting patches from git tree Paul Eggleton
2014-12-19 11:41 ` [PATCH 08/15] lib/oe: add recipeutils module Paul Eggleton
2014-12-19 11:41 ` [PATCH 09/15] oeqa/utils: make get_bb_var() more reliable Paul Eggleton
2014-12-19 11:41 ` [PATCH 10/15] classes/externalsrc: set do_compile as nostamp Paul Eggleton
2014-12-19 11:41 ` [PATCH 11/15] scripts/recipetool: Add a recipe auto-creation script Paul Eggleton
2014-12-19 11:41 ` [PATCH 12/15] scripts: add scriptutils module Paul Eggleton
2014-12-19 11:41 ` [PATCH 13/15] scripts/devtool: add development helper tool Paul Eggleton
2014-12-19 11:41 ` [PATCH 14/15] scripts/devtool: Support deploy/undeploy function Paul Eggleton
2014-12-19 11:41 ` [PATCH 15/15] devtool: add QA tests Paul Eggleton
2014-12-23 12:30 ` [PATCH 00/15] Developer workflow tools Trevor Woerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c202c0a55897c061b5ccb8d581d5abe8997d1b4e.1418984743.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox