modified BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
authorjljusten <jljusten@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 14 Dec 2007 01:22:26 +0000 (01:22 +0000)
committerjljusten <jljusten@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 14 Dec 2007 01:22:26 +0000 (01:22 +0000)
  In ReplaceWorkspaceMacro routine, do not call os.path.realpath
  as it replaces symbolic links.  Instead use os.path.abspath
  if the path is not an absolute path.  This change allows
  $(WORKSPACE) to contain a symbolic link.

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@925 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/GenFds/GenFdsGlobalVariable.py

index f1372ab..e0703cf 100644 (file)
@@ -117,7 +117,8 @@ class GenFdsGlobalVariable:
     def ReplaceWorkspaceMacro(String):\r
         Str = String.replace('$(WORKSPACE)', GenFdsGlobalVariable.WorkSpaceDir)\r
         if os.path.exists(Str):\r
-            Str = os.path.realpath(Str)\r
+            if not os.path.isabs(Str):\r
+                Str = os.path.abspath(Str)\r
         else:\r
             Str = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, String)\r
         return os.path.normpath(Str)\r