From nobody Mon Apr 29 10:31:52 2024 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 1489105529631147.1341445364227; Thu, 9 Mar 2017 16:25:29 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C36FB8038D; Thu, 9 Mar 2017 16:25:27 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 A517980329 for ; Thu, 9 Mar 2017 16:25:25 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2017 16:25:25 -0800 Received: from tiano01.ccr.corp.intel.com ([10.239.9.111]) by orsmga003.jf.intel.com with ESMTP; 09 Mar 2017 16:25:24 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,137,1486454400"; d="scan'208";a="942647920" From: hesschen To: edk2-devel@lists.01.org Date: Fri, 10 Mar 2017 08:25:21 +0800 Message-Id: <1489105521-146108-1-git-send-email-hesheng.chen@intel.com> X-Mailer: git-send-email 2.7.2.windows.1 Subject: [edk2] [patch] BaseTools/UPT: Fix an issue in subst command X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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" UPT used to use "B:" as the temp directory which may cause conflict, now it will choose a valid volume. Also UPT now accepts empty sections. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen Reviewed-by: Yonghong Zhu =20 --- .../UPT/Parser/InfGuidPpiProtocolSectionParser.py | 7 ++++--- BaseTools/Source/Python/UPT/UPT.py | 20 +++++++++++-----= ---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionPa= rser.py b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParse= r.py index 10a82cb..12ffeda 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py @@ -1,7 +1,7 @@ ## @file # This file contained the parser for [Guids], [Ppis], [Protocols] sections= in INF file=20 # -# Copyright (c) 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made availa= ble=20 # under the terms and conditions of the BSD License which accompanies this=20 @@ -217,8 +217,9 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): for Line in SectionString: LineContent =3D Line[0] =20 - if LineContent.strip() =3D=3D '': - continue +# Comment the code to support user extension without any statement just th= e section header in [] +# if LineContent.strip() =3D=3D '': +# continue =20 UserExtensionContent +=3D LineContent + DT.END_OF_LINE continue diff --git a/BaseTools/Source/Python/UPT/UPT.py b/BaseTools/Source/Python/U= PT/UPT.py index 8dd949a..873492d 100644 --- a/BaseTools/Source/Python/UPT/UPT.py +++ b/BaseTools/Source/Python/UPT/UPT.py @@ -2,7 +2,7 @@ # # This file is the main entry for UPT=20 # -# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made availa= ble=20 # under the terms and conditions of the BSD License which accompanies this=20 @@ -179,15 +179,16 @@ def Main(): Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc()) return XExcept.args[0] =20 - # Start ********************************************* # Support WORKSPACE is a long path - # Only work well on windows - # Linux Solution TBD + # Only works for windows system if pf.system() =3D=3D 'Windows': - os.system('@echo off\nsubst b: /D') - os.system('subst b: "%s"' % GlobalData.gWORKSPACE) - GlobalData.gWORKSPACE =3D 'B:\\' - # End *********************************************** + Vol =3D 'B:' + for Index in range(90, 65, -1): + Vol =3D chr(Index) + ':' + if not os.path.isdir(Vol): + os.system('subst %s "%s"' % (Vol, GlobalData.gWORKSPACE)) + break + GlobalData.gWORKSPACE =3D '%s\\' % Vol =20 WorkspaceDir =3D GlobalData.gWORKSPACE =20 @@ -304,8 +305,9 @@ def Main(): except StandardError: Logger.Quiet(ST.MSG_RECOVER_FAIL) GlobalData.gDB.CloseDb() + if pf.system() =3D=3D 'Windows': - os.system('subst b: /D') + os.system('subst %s /D' % GlobalData.gWORKSPACE.replace('\\','= ')) =20 return ReturnCode =20 --=20 2.7.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel