From nobody Sat Jul 12 10:27:14 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496908174818502.58733848211955; Thu, 8 Jun 2017 00:49:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 43E8B2094554C; Thu, 8 Jun 2017 00:48:22 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC4C920945523 for ; Thu, 8 Jun 2017 00:48:20 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2017 00:49:29 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga005.fm.intel.com with ESMTP; 08 Jun 2017 00:49:28 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,313,1493708400"; d="scan'208";a="111854284" From: Hao Wu To: edk2-devel@lists.01.org Date: Thu, 8 Jun 2017 15:49:23 +0800 Message-Id: <20170608074924.12900-2-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170608074924.12900-1-hao.a.wu@intel.com> References: <20170608074924.12900-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 1/2] BaseTools/PatchCheck.py: Fix misreport for binary changes in patch X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao Wu , Jordan Justen , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" For a patch file that: 1. Contains a binary change 2. Contains any other changes after the binary change PatchCheck.py will complains with the following error: * Patch format error: diff found after end of patch Line: literal XXXX This commit resolves this misreport. Cc: Liming Gao Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- BaseTools/Scripts/PatchCheck.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index 7c3008233c..4bc697b1af 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -1,7 +1,7 @@ ## @file # Check a patch for various format issues # -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made # available under the terms and conditions of the BSD License which @@ -265,7 +265,7 @@ class GitDiffCheck: if line.startswith('@@ '): self.state =3D PRE_PATCH elif len(line) >=3D 1 and line[0] not in ' -+' and \ - not line.startswith(r'\ No newline '): + not line.startswith(r'\ No newline ') and not self.binary: for line in self.lines[self.line_num + 1:]: if line.startswith('diff --git'): self.format_error('diff found after end of patch') @@ -300,7 +300,7 @@ class GitDiffCheck: elif self.state =3D=3D PATCH: if self.binary: pass - if line.startswith('-'): + elif line.startswith('-'): pass elif line.startswith('+'): self.check_added_line(line[1:]) --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel