From 1e69581335354a7df3bc07b21e495b0b3c5909c0 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Wed, 14 Oct 2015 09:43:43 +0000 Subject: [PATCH] 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 Reviewed-by: Yonghong Zhu git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18602 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/Common/MultipleWorkspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTools/Source/Python/Common/MultipleWorkspace.py index 8088404f30..feb1f8d5eb 100644 --- a/BaseTools/Source/Python/Common/MultipleWorkspace.py +++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py @@ -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() -- 2.39.2