]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the issue to support windows root directory
authorLiming Gao <liming.gao@intel.com>
Wed, 14 Oct 2015 09:43:43 +0000 (09:43 +0000)
committerlgao4 <lgao4@Edk2>
Wed, 14 Oct 2015 09:43:43 +0000 (09:43 +0000)
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

BaseTools/Source/Python/Common/MultipleWorkspace.py

index 8088404f30eb2941e50409946f71123225cd3aea..feb1f8d5ebe6e67706045c31b5c459d6936b1008 100644 (file)
@@ -41,7 +41,7 @@ class MultipleWorkspace(object):
     @classmethod\r
     def convertPackagePath(cls, Ws, Path):\r
         if str(os.path.normcase (Path)).startswith(Ws):\r
-            return os.path.join(Ws, Path[len(Ws) + 1:])\r
+            return os.path.join(Ws, os.path.relpath(Path, Ws))\r
         return Path\r
 \r
     ## setWs()\r