## @file\r
# This file contained the parser for [Guids], [Ppis], [Protocols] sections in INF file \r
#\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials are licensed and made available \r
# under the terms and conditions of the BSD License which accompanies this \r
for Line in SectionString:\r
LineContent = Line[0]\r
\r
- if LineContent.strip() == '':\r
- continue\r
+# Comment the code to support user extension without any statement just the section header in []\r
+# if LineContent.strip() == '':\r
+# continue\r
\r
UserExtensionContent += LineContent + DT.END_OF_LINE\r
continue\r
#\r
# This file is the main entry for UPT \r
#\r
-# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials are licensed and made available \r
# under the terms and conditions of the BSD License which accompanies this \r
Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + format_exc())\r
return XExcept.args[0]\r
\r
- # Start *********************************************\r
# Support WORKSPACE is a long path\r
- # Only work well on windows\r
- # Linux Solution TBD\r
+ # Only works for windows system\r
if pf.system() == 'Windows':\r
- os.system('@echo off\nsubst b: /D')\r
- os.system('subst b: "%s"' % GlobalData.gWORKSPACE)\r
- GlobalData.gWORKSPACE = 'B:\\'\r
- # End ***********************************************\r
+ Vol = 'B:'\r
+ for Index in range(90, 65, -1):\r
+ Vol = chr(Index) + ':'\r
+ if not os.path.isdir(Vol):\r
+ os.system('subst %s "%s"' % (Vol, GlobalData.gWORKSPACE))\r
+ break\r
+ GlobalData.gWORKSPACE = '%s\\' % Vol\r
\r
WorkspaceDir = GlobalData.gWORKSPACE\r
\r
except StandardError:\r
Logger.Quiet(ST.MSG_RECOVER_FAIL)\r
GlobalData.gDB.CloseDb()\r
+\r
if pf.system() == 'Windows':\r
- os.system('subst b: /D')\r
+ os.system('subst %s /D' % GlobalData.gWORKSPACE.replace('\\',''))\r
\r
return ReturnCode\r
\r