From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org 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 161CD21159C83 for ; Thu, 27 Sep 2018 08:44:38 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2018 08:44:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,311,1534834800"; d="scan'208";a="89978012" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 27 Sep 2018 08:40:37 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Sep 2018 08:40:36 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Sep 2018 08:40:36 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.183]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.27]) with mapi id 14.03.0319.002; Thu, 27 Sep 2018 23:40:34 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: remove the not used PyUtility file Thread-Index: AQHUTl7XpwPCAfTJWEmY9u92bf9WeKUEVBWQ Date: Thu, 27 Sep 2018 15:40:33 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E31C9CF@SHSMSX104.ccr.corp.intel.com> References: <1537172215-9500-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1537172215-9500-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjAxOWNhMDAtM2RlOC00OTE1LWExNTUtMTNkMzY4NjYzN2EyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYzIrZDVzNFFsQWhCZFlheFwvQjEwbG9UYURFUTQwOHpHemdTK3hyb0oxTUZrUURGMGhGMG5Zcjk4WUthMEllM0UifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: remove the not used PyUtility file X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 15:44:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yo= nghong Zhu > Sent: Monday, September 17, 2018 4:17 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: remove the not used PyUtility file >=20 > the PyUtility is not used, so we remove it. >=20 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/C/PyUtility/Makefile | 25 ------- > BaseTools/Source/C/PyUtility/PyUtility.c | 106 ---------------------= ------ > BaseTools/Source/C/PyUtility/setup.py | 42 ----------- > BaseTools/Source/Python/Common/Misc.py | 16 +--- > BaseTools/Source/Python/Common/PyUtility.pyd | Bin 6144 -> 0 bytes > 5 files changed, 3 insertions(+), 186 deletions(-) > delete mode 100644 BaseTools/Source/C/PyUtility/Makefile > delete mode 100644 BaseTools/Source/C/PyUtility/PyUtility.c > delete mode 100644 BaseTools/Source/C/PyUtility/setup.py > delete mode 100644 BaseTools/Source/Python/Common/PyUtility.pyd >=20 > diff --git a/BaseTools/Source/C/PyUtility/Makefile b/BaseTools/Source/C/P= yUtility/Makefile > deleted file mode 100644 > index 5829070..0000000 > --- a/BaseTools/Source/C/PyUtility/Makefile > +++ /dev/null > @@ -1,25 +0,0 @@ > -## @file > -# Makefile > -# > -# Copyright (c) 2007 - 2014, 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 accompanies this distribution. The full text of the license m= ay be found at > -# http://opensource.org/licenses/bsd-license.php > -# > -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. > -# > - > -!INCLUDE ..\Makefiles\ms.common > - > -APPNAME =3D GenSec > - > -LIBS =3D $(LIB_PATH)\Common.lib > - > -OBJECTS =3D PyUtility.obj > - > -#CFLAGS =3D $(CFLAGS) /nodefaultlib:libc.lib > - > -!INCLUDE ..\Makefiles\ms.app > - > diff --git a/BaseTools/Source/C/PyUtility/PyUtility.c b/BaseTools/Source/= C/PyUtility/PyUtility.c > deleted file mode 100644 > index d14b872..0000000 > --- a/BaseTools/Source/C/PyUtility/PyUtility.c > +++ /dev/null > @@ -1,106 +0,0 @@ > -/** @file > -Python Utility > - > -Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> -This program and the accompanying materials are licensed and made availa= ble > -under the terms and conditions of the BSD License which accompanies this > -distribution. The full text of the license may be found at > -http://opensource.org/licenses/bsd-license.php > - > -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. > - > -**/ > - > -#include > -#include > -#include > - > -/* > - SaveFileToDisk(FilePath, Content) > -*/ > -STATIC > -PyObject* > -SaveFileToDisk ( > - PyObject *Self, > - PyObject *Args > - ) > -{ > - CHAR8 *File; > - UINT8 *Data; > - UINTN DataLength; > - UINTN WriteBytes; > - UINTN Status; > - HANDLE FileHandle; > - PyObject *ReturnValue =3D Py_False; > - > - Status =3D PyArg_ParseTuple( > - Args, > - "ss#", > - &File, > - &Data, > - &DataLength > - ); > - if (Status =3D=3D 0) { > - return NULL; > - } > - > - FileHandle =3D CreateFile( > - File, > - GENERIC_WRITE, > - FILE_SHARE_WRITE|FILE_SHARE_READ|FILE_SHARE_DELETE, > - NULL, > - CREATE_ALWAYS, > - FILE_ATTRIBUTE_NORMAL, > - NULL > - ); > - if (FileHandle =3D=3D INVALID_HANDLE_VALUE) { > - PyErr_SetString(PyExc_Exception, "File creation failure"); > - return NULL; > - } > - > - while (WriteFile(FileHandle, Data, DataLength, &WriteBytes, NULL)) { > - if (DataLength <=3D WriteBytes) { > - DataLength =3D 0; > - break; > - } > - > - Data +=3D WriteBytes; > - DataLength -=3D WriteBytes; > - } > - > - if (DataLength !=3D 0) { > - // file saved unsuccessfully > - PyErr_SetString(PyExc_Exception, "File write failure"); > - goto Done; > - } > - > - // > - // Flush buffer may slow down the whole build performance (average 10s= slower) > - // > - //if (!FlushFileBuffers(FileHandle)) { > - // PyErr_SetString(PyExc_Exception, "File flush failure"); > - // goto Done; > - //} > - > - // success! > - ReturnValue =3D Py_True; > - > -Done: > - CloseHandle(FileHandle); > - return ReturnValue; > -} > - > -STATIC INT8 SaveFileToDiskDocs[] =3D "SaveFileToDisk(): Make sure the fi= le is saved to disk\n"; > - > -STATIC PyMethodDef PyUtility_Funcs[] =3D { > - {"SaveFileToDisk", (PyCFunction)SaveFileToDisk, METH_VARARGS, SaveFile= ToDiskDocs}, > - {NULL, NULL, 0, NULL} > -}; > - > -PyMODINIT_FUNC > -initPyUtility(VOID) { > - Py_InitModule3("PyUtility", PyUtility_Funcs, "Utilties Module Implemen= ted C Language"); > -} > - > - > diff --git a/BaseTools/Source/C/PyUtility/setup.py b/BaseTools/Source/C/P= yUtility/setup.py > deleted file mode 100644 > index e4d407d..0000000 > --- a/BaseTools/Source/C/PyUtility/setup.py > +++ /dev/null > @@ -1,42 +0,0 @@ > -## @file > -# package and install PyEfiCompressor extension > -# > -# Copyright (c) 2008, 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 accompanies this distribution. The full text of the license ma= y be found at > -# http://opensource.org/licenses/bsd-license.php > -# > -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. > -# > - > -## > -# Import Modules > -# > -from distutils.core import setup, Extension > -import os > - > -if 'BASE_TOOLS_PATH' not in os.environ: > - raise "Please define BASE_TOOLS_PATH to the root of base tools tree" > - > -BaseToolsDir =3D os.environ['BASE_TOOLS_PATH'] > -setup( > - name=3D"PyUtility", > - version=3D"0.01", > - ext_modules=3D[ > - Extension( > - 'PyUtility', > - sources=3D[ > - 'PyUtility.c' > - ], > - include_dirs=3D[ > - os.path.join(BaseToolsDir, 'Source', 'C', 'Include'), > - os.path.join(BaseToolsDir, 'Source', 'C', 'Include', 'Ia= 32'), > - os.path.join(BaseToolsDir, 'Source', 'C', 'Common') > - ], > - ) > - ], > - ) > - > diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Py= thon/Common/Misc.py > index fc90ccb..faa4cdf 100644 > --- a/BaseTools/Source/Python/Common/Misc.py > +++ b/BaseTools/Source/Python/Common/Misc.py > @@ -472,23 +472,13 @@ def SaveFileOnChange(File, Content, IsBinaryFile=3D= True): > DirName =3D os.getcwd() > if not os.access(DirName, os.W_OK): > EdkLogger.error(None, PERMISSION_FAILURE, "Do not have write= permission on directory %s" % DirName) >=20 > try: > - if GlobalData.gIsWindows: > - try: > - from .PyUtility import SaveFileToDisk > - if not SaveFileToDisk(File, Content): > - EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData= =3DFile) > - except: > - Fd =3D open(File, "wb") > - Fd.write(Content) > - Fd.close() > - else: > - Fd =3D open(File, "wb") > - Fd.write(Content) > - Fd.close() > + Fd =3D open(File, "wb") > + Fd.write(Content) > + Fd.close() > except IOError as X: > EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData=3D'IOError = %s' % X) >=20 > return True >=20 > diff --git a/BaseTools/Source/Python/Common/PyUtility.pyd b/BaseTools/Sou= rce/Python/Common/PyUtility.pyd > deleted file mode 100644 > index 856b508e4ea39a806fbe52264ac5e4db0956a2de..0000000000000000000000000= 000000000000000 > GIT binary patch > literal 0 > HcmV?d00001 >=20 > literal 6144 > zcmeHLe{hrK9e*LWve_ASI=3Dx2o0fm+ayhs`sRIE > ztFXg`&gEXKZh9Oy-AS*z!|n7=3DJsll53AD4Ib%zWqo1NFW>VoaG3PRm#-+i7pDYS^* > z?XPWjKDqDn z-zcc|2cpJSKGMW{TZ|3fa5y3ucXCEv3>yPs z8a^6WA9@|@x3_eq$3vl$%KA6TI>C2^UQ_s)&|ek&^PzraJecO|R>n<%20xWK?Sacd > zNTo_cPUOE^HH{l4>VkQyY(nNzM^f0=3D^DycGMrEy6=3D4wJRmF3luxPYKRLjxHNo9MnP > zV`}+aAt4)peX@WkTPVkMTNx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=3D>t;Dw0w$;{Z+haRoJ7ycUy>EMZ#j`7= p > zt@z7|PgY!Bv7@B1Bvite#7Z71`9;Z*k}SK z`|PjT|7`!zK5oBcpR}u4Et|{U#4cn_>{8asvg{gmJzK?YXB*jO_FndWb|3o)`viNC > zeU5#JJ<1+u-)7%sKVXS5^;qpO_nA+cbr!wFW!YlcW@)oLZaH8 I{@=3Dv?8;(I;UjP6A >=20 > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel