Fixed an issue which will cause files not found
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 21 Apr 2008 06:19:15 +0000 (06:19 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 21 Apr 2008 06:19:15 +0000 (06:19 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1166 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/GenFds/GenFds.py
Source/Python/Workspace/WorkspaceDatabase.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
index 8744cf9..5bf8752 100644 (file)
@@ -1829,13 +1829,10 @@ class WorkspaceDatabase(object):
 \r
     def _GetPackageList(self):\r
         PackageList = []\r
-        for PackageFile in self.TblFile.GetFileList(MODEL_FILE_DEC):\r
-            try:\r
-                Package = self.BuildObject[PackageFile, 'COMMON']\r
-            except:\r
-                Package = None\r
-            if Package != None:\r
-                PackageList.append(Package)\r
+        for Module in self.ModuleList:\r
+            for Package in Module.Packages:\r
+                if Package not in PackageList:\r
+                    PackageList.append(Package)\r
         return PackageList\r
 \r
     def _GetPlatformList(self):\r