BaseTools: Fix the issue to support windows root directory
Use os.path.relpath to get the relative directory instead of directly trim it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18602 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -41,7 +41,7 @@ class MultipleWorkspace(object):
|
||||
@classmethod
|
||||
def convertPackagePath(cls, Ws, Path):
|
||||
if str(os.path.normcase (Path)).startswith(Ws):
|
||||
return os.path.join(Ws, Path[len(Ws) + 1:])
|
||||
return os.path.join(Ws, os.path.relpath(Path, Ws))
|
||||
return Path
|
||||
|
||||
## setWs()
|
||||
|
Reference in New Issue
Block a user