Fixed an issue which will cause files not found
[people/mcb30/basetools.git] / Source / Python / GenFds / GenFds.py
index ef6a3d1..dad6305 100644 (file)
@@ -74,6 +74,7 @@ def main():
                 GenFdsGlobalVariable.EdkSourceDir = os.environ['EDK_SOURCE']\r
             if (Options.debug):\r
                 GenFdsGlobalVariable.VerboseLogger( "Using Workspace:" + Workspace)\r
+        os.chdir(GenFdsGlobalVariable.WorkSpaceDir)\r
     \r
         if (Options.filename):\r
             FdfFilename = Options.filename\r
@@ -102,7 +103,7 @@ def main():
         if not os.path.exists(FdfFilename):\r
             GenFdsGlobalVariable.ErrorLogger ("File %s not found" % (FdfFilename))\r
             sys.exit(1)\r
-    \r
+\r
         if (Options.activePlatform):\r
             ActivePlatform = Options.activePlatform\r
             ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)\r
@@ -156,11 +157,11 @@ def main():
             \r
         """call Workspace build create database"""\r
         os.environ["WORKSPACE"] = Workspace\r
-        BuildWorkSpace = WorkspaceDatabase('', GlobalData.gGlobalDefines)\r
+        BuildWorkSpace = WorkspaceDatabase(':memory:', GlobalData.gGlobalDefines)\r
         BuildWorkSpace.InitDatabase()\r
 \r
         for Arch in ArchList:\r
-            GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch].OutputDirectory)\r
+            GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[ActivePlatform, Arch].OutputDirectory)\r
         \r
         if (Options.outputDir):\r
             OutputDirFromCommandLine = GenFdsGlobalVariable.ReplaceWorkspaceMacro(Options.outputDir)\r