From patchwork Sat Mar 22 23:13:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 332850 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 007EB2C00A1 for ; Sun, 23 Mar 2014 10:14:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 727254B5FF; Sun, 23 Mar 2014 00:14:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bQxXYmabzGjW; Sun, 23 Mar 2014 00:14:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA3124B5EB; Sun, 23 Mar 2014 00:14:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AC8064B5EB for ; Sun, 23 Mar 2014 00:14:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tr8ubxZ1x4Zu for ; Sun, 23 Mar 2014 00:14:13 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ve0-f202.google.com (mail-ve0-f202.google.com [209.85.128.202]) by theia.denx.de (Postfix) with ESMTPS id 8AD944B5E4 for ; Sun, 23 Mar 2014 00:14:08 +0100 (CET) Received: by mail-ve0-f202.google.com with SMTP id pa12so482773veb.1 for ; Sat, 22 Mar 2014 16:14:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KiNdXeVVM/CT/G3HQHRXxQ/ONY/Pd9IPjZ8ZCJDpkA4=; b=juZ4WrglAfqRgVAllQ2g5thltmQuKMmnVVmHc+8VxNGQX8rfbvFcSdTMnI/0XqV/iC vWBX3gvHP1Nfcxv49tYphosZMnbvtt9QNCLycV2bMpPynMTz1l538l/MB0pbvc/r+e6e QTntqgkxuw12bkWorCtTX6kitzX+wxe/RDLtFpuV9Xs+gBcDtXXzzYrliYoot3UBISYE Rht2mD2mB2DIfPiNm6a27MPUdZPiTedyK2FBA1TiOqkEIu8GmYeP1QswjZo1Abq04/dD xm421erUsyoH9bHtVlgKADblRvN4BlOSwfRApEOirh+dNjWqZwLGRCbJuj/wMn1Q8T4K nOsQ== X-Gm-Message-State: ALoCoQka5BpZlHX6g9y/rZqxjdMRnvTewMS5gmFwITZuWPtjTEHYINpvwf1mCG1VCQ+H35y+LsgqFq2mk+AmI6yLCnIhwSJUuVxnkk4/m5qTSc/tVVCFilAAncSI4lhjqCSKKPTcCEla5lm0BP4x+sfNH9XQqInQSGyE9CSpCAFGW++dRqgJF/02CWT0JKHxG8Z8YQYIUx4D X-Received: by 10.58.88.136 with SMTP id bg8mr14418529veb.21.1395530046532; Sat, 22 Mar 2014 16:14:06 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id m3si1460466igk.2.2014.03.22.16.14.06 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Mar 2014 16:14:06 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 0651031C252; Sat, 22 Mar 2014 16:14:06 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 71F3C220C8F; Sat, 22 Mar 2014 17:14:05 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 22 Mar 2014 17:13:56 -0600 Message-Id: <1395530037-19588-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a Subject: [U-Boot] [PATCH 1/2] patman: Deal with 'git apply' failures correctly X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This sort of failure is rare, but the code to deal with it is wrong. Fix it. Signed-off-by: Simon Glass --- tools/patman/gitutil.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 5dcbaa3..3ea256d 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -11,6 +11,7 @@ import subprocess import sys import terminal +import checkpatch import settings @@ -193,6 +194,7 @@ def ApplyPatch(verbose, fname): Args: fname: filename of patch file to apply """ + col = terminal.Color() cmd = ['git', 'am', fname] pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -203,8 +205,8 @@ def ApplyPatch(verbose, fname): print line match = re_error.match(line) if match: - print GetWarningMsg('warning', match.group(1), int(match.group(2)), - 'Patch failed') + print checkpatch.GetWarningMsg(col, 'warning', match.group(1), + int(match.group(2)), 'Patch failed') return pipe.returncode == 0, stdout def ApplyPatches(verbose, args, start_point):