Browse Source

command/cooker: Remve the need for the cache for -e -b options

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Richard Purdie 15 years ago
parent
commit
21b5e1d2fc
2 changed files with 12 additions and 10 deletions
  1. 9 7
      lib/bb/command.py
  2. 3 3
      lib/bb/cooker.py

+ 9 - 7
lib/bb/command.py

@@ -202,23 +202,25 @@ class CommandsAsync:
         command.finishAsyncCommand()
     showVersions.needcache = True
 
-    def showEnvironmentPackage(self, command, params):
+    def showEnvironmentTarget(self, command, params):
         """
-        Print the environment of a recipe
+        Print the environment of a target recipe
+        (needs the cache to work out which recipe to use)
         """
-        bfile = params[0]
-        pkg = params[1]
+        pkg = params[0]
 
-        command.cooker.showEnvironment(bfile, pkg)
+        command.cooker.showEnvironment(None, pkg)
         command.finishAsyncCommand()
-    showEnvironmentPackage.needcache = True
+    showEnvironmentTarget.needcache = True
 
     def showEnvironment(self, command, params):
         """
         Print the standard environment
+        or if specified the environment for a specified recipe
         """
+        bfile = params[0]
 
-        command.cooker.showEnvironment()
+        command.cooker.showEnvironment(bfile)
         command.finishAsyncCommand()
     showEnvironment.needcache = False
 

+ 3 - 3
lib/bb/cooker.py

@@ -141,10 +141,10 @@ class BBCooker:
                 bb.error("Only one target can be used with the --environment option.")
             elif self.configuration.buildfile and len(self.configuration.pkgs_to_build) > 0:
                 bb.error("No target should be used with the --environment and --buildfile options.")
-            elif self.configuration.buildfile is not None or len(self.configuration.pkgs_to_build) > 0:
-                self.commandlineAction = ["showEnvironmentPackage", self.configuration.buildfile, self.configuration.pkgs_to_build]
+            elif len(self.configuration.pkgs_to_build) > 0:
+                self.commandlineAction = ["showEnvironmentTarget", self.configuration.pkgs_to_build]
             else:
-                self.commandlineAction = ["showEnvironment"]
+                self.commandlineAction = ["showEnvironment", self.configuration.buildfile]
         elif self.configuration.buildfile is not None:
             self.commandlineAction = ["buildFile", self.configuration.buildfile, self.configuration.cmd]
         elif self.configuration.show_versions: