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
@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