]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Change RealPath to AbsPath
authorChen, Christine <Yuwei.Chen@intel.com>
Tue, 12 Oct 2021 04:07:38 +0000 (12:07 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 13 Oct 2021 09:07:16 +0000 (09:07 +0000)
Currently the realpath is used when parse modules, which shows the
path with a drive letter in build log. In Windows 'subst' comand is
used to associates a path with a drive letter, when use the mapped
drive letter for build, with realpath function the build log will
have different disk letter info which will cause confusion. In this
situation, if use adspath function to show the path info, it will keep
same letter with the mapped drive letter, which avoids confusion.
This patch modifies the realpath to abspath.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@Intel.com>
BaseTools/Source/Python/Ecc/EccMain.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/GenFds.py

index 72edbea3b8831aae38f99ea2e5fbd81db93023a5..a349cd80147f9019c8a5902c74512f9beef99459 100644 (file)
@@ -105,7 +105,7 @@ class Ecc(object):
 \r
     def InitDefaultConfigIni(self):\r
         paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path)\r
-        paths = (os.path.realpath('config.ini'),) + tuple(paths)\r
+        paths = (os.path.abspath('config.ini'),) + tuple(paths)\r
         for path in paths:\r
             if os.path.exists(path):\r
                 self.ConfigFile = path\r
index 20573ca28d2f2c24a950d68de7ca733122d7eec3..568efb6d76859ec447514a6e61ef799c0ea2de7b 100644 (file)
@@ -707,8 +707,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
                                   FileName,\r
                                   'DEBUG'\r
                                   )\r
-        OutputPath = os.path.realpath(OutputPath)\r
-        DebugPath = os.path.realpath(DebugPath)\r
+        OutputPath = os.path.abspath(OutputPath)\r
+        DebugPath = os.path.abspath(DebugPath)\r
         return OutputPath, DebugPath\r
 \r
     ## __GenSimpleFileSection__() method\r
index c34104500059f89eb5fe2657d26ff9a05f7ee001..17b71b7cd347993edb8b414c05618bfeb7de0a80 100644 (file)
@@ -153,7 +153,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
             FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)\r
 \r
             if FdfFilename[0:2] == '..':\r
-                FdfFilename = os.path.realpath(FdfFilename)\r
+                FdfFilename = os.path.abspath(FdfFilename)\r
             if not os.path.isabs(FdfFilename):\r
                 FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)\r
             if not os.path.exists(FdfFilename):\r
@@ -175,7 +175,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
             ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)\r
 \r
             if ActivePlatform[0:2] == '..':\r
-                ActivePlatform = os.path.realpath(ActivePlatform)\r
+                ActivePlatform = os.path.abspath(ActivePlatform)\r
 \r
             if not os.path.isabs (ActivePlatform):\r
                 ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)\r
@@ -299,7 +299,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
         for Key in GenFdsGlobalVariable.OutputDirDict:\r
             OutputDir = GenFdsGlobalVariable.OutputDirDict[Key]\r
             if OutputDir[0:2] == '..':\r
-                OutputDir = os.path.realpath(OutputDir)\r
+                OutputDir = os.path.abspath(OutputDir)\r
 \r
             if OutputDir[1] != ':':\r
                 OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir)\r