#\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