From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mail.openembedded.org (Postfix) with ESMTP id 3B88E7291C for ; Fri, 19 Dec 2014 11:42:10 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 19 Dec 2014 03:42:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,606,1413270000"; d="scan'208";a="640244375" Received: from khamid-mobl1.ger.corp.intel.com (HELO peggleto-mobl5.ger.corp.intel.com) ([10.252.31.61]) by fmsmga001.fm.intel.com with ESMTP; 19 Dec 2014 03:42:10 -0800 From: Paul Eggleton To: openembedded-core@lists.openembedded.org Date: Fri, 19 Dec 2014 11:41:48 +0000 Message-Id: X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH 06/15] lib/oe/patch.py: abort "git am" if it fails X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 11:42:10 -0000 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 --- 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