From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: zhijux.fan@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 26 Jun 2019 19:55:02 -0700 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 19:55:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,422,1557212400"; d="dat'59?scan'59,208,59";a="185105407" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 26 Jun 2019 19:55:01 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Jun 2019 19:55:00 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 26 Jun 2019 19:54:57 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 26 Jun 2019 19:54:57 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.87]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.173]) with mapi id 14.03.0439.000; Thu, 27 Jun 2019 10:54:56 +0800 From: "Fan, ZhijuX" To: "devel@edk2.groups.io" CC: "Gao, Liming" , "Feng, Bob C" Subject: [PATCH] BaseTools:Updata the Judgment Method of "--exclude" Thread-Topic: [PATCH] BaseTools:Updata the Judgment Method of "--exclude" Thread-Index: AdUsk7JItFlsklTWQi2SOJVElPpinA== Date: Thu, 27 Jun 2019 02:54:55 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhijux.fan@intel.com X-Groupsio-MsgNum: 42915 Content-Type: multipart/mixed; boundary="_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AF85016SHSMSX101ccrcor_" Content-Language: en-US --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AF85016SHSMSX101ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1944 --exclude cannot be used under certain circumstances 1.The value of the parameter USES an absolute path 2.The value of Exclude parameters is based on the value=20 of the Path parameter Neither of these approaches currently works This patch is going to fix that issue. Cc: Liming Gao Cc: Bob Feng Signed-off-by: Zhiju.Fan --- BaseTools/Scripts/FormatDosFiles.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/BaseTools/Scripts/FormatDosFiles.py b/BaseTools/Scripts/Format= DosFiles.py index d9a880f299..7a5af209f2 100644 --- a/BaseTools/Scripts/FormatDosFiles.py +++ b/BaseTools/Scripts/FormatDosFiles.py @@ -20,7 +20,7 @@ import copy =20 __prog__ =3D 'FormatDosFiles' __version__ =3D '%s Version %s' % (__prog__, '0.10 ') -__copyright__ =3D 'Copyright (c) 2018, Intel Corporation. All rights res= erved.' +__copyright__ =3D 'Copyright (c) 2019, Intel Corporation. All rights res= erved.' __description__ =3D 'Convert source files to meet the EDKII C Coding Stand= ards Specification.\n' DEFAULT_EXT_LIST =3D ['.h', '.c', '.nasm', '.nasmb', '.asm', '.S', '.inf',= '.dec', '.dsc', '.fdf', '.uni', '.asl', '.aslc', '.vfr', '.idf', '.txt', '= .bat', '.py'] =20 @@ -46,10 +46,22 @@ def FormatFile(FilePath, Args): def FormatFilesInDir(DirPath, ExtList, Args): =20 FileList =3D [] + ExcludeDir =3D DirPath for DirPath, DirNames, FileNames in os.walk(DirPath): if Args.Exclude: - DirNames[:] =3D [d for d in DirNames if d not in Args.Exclude] - FileNames[:] =3D [f for f in FileNames if f not in Args.Exclud= e] + Continue =3D False + for Path in Args.Exclude: + if not os.path.isdir(Path) and not os.path.isfile(Path): + Path =3D os.path.join(ExcludeDir, Path) + if os.path.isdir(Path) and Path.endswith(DirPath): + Continue =3D True + elif os.path.isfile(Path): + for ItemPath in FileNames[:]: + FilePath =3D os.path.join(DirPath, ItemPath) + if Path.endswith(FilePath): + FileNames.remove(ItemPath) + if Continue: + continue for FileName in [f for f in FileNames if any(f.endswith(ext) for e= xt in ExtList)]: FileList.append(os.path.join(DirPath, FileName)) for File in FileList: --=20 2.14.1.windows.1 --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AF85016SHSMSX101ccrcor_ Content-Disposition: attachment; filename="winmail.dat" Content-Transfer-Encoding: base64 Content-Type: application/ms-tnef; name="winmail.dat" eJ8+IuQwAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEJgAEAIQAAADRCOEIyNTJB QTcxQjFGNDNBMkFCRjI0MzUwQ0NEMDc3ADUHAQ2ABAACAAAAAgACAAEFgAMADgAAAOMHBgAbAAIA NgA3AAQAfgEBIIADAA4AAADjBwYAGwACADYANwAEAH4BAQiABwAYAAAASVBNLk1pY3Jvc29mdCBN YWlsLk5vdGUAMQgBBIABADwAAABbUEFUQ0hdIEJhc2VUb29sczpVcGRhdGEgdGhlIEp1ZGdtZW50 IE1ldGhvZCBvZiAiLS1leGNsdWRlIgBKFAELgAEAIQAAADRCOEIyNTJBQTcxQjFGNDNBMkFCRjI0 MzUwQ0NEMDc3ADUHAQOQB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