This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 bitbake-dev/lib/bb/command.py        |    9 ++++++---
 bitbake-dev/lib/bb/cooker.py         |   26 +++++++++++++-------------
 bitbake-dev/lib/bb/runqueue.py       |    3 +--
 bitbake-dev/lib/bb/shell.py          |   12 ++----------
 bitbake-dev/lib/bb/ui/depexplorer.py |    2 +-
 5 files changed, 23 insertions(+), 29 deletions(-)

New commits:
commit f5c494bba5be9204f440c87771001300ccde900a
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Fri Oct 24 17:37:46 2008 +0100

    bitbake-dev: Remove use of self.configuration.cmd as state from shell
    
    The shell updated the self.configuration.cmd variable since commans relied 
on
    this implicit state. Since those commands now have an explicit task 
parameter
    such state manipulation is no longer necessary.

commit 790ed683565e56ef513bad568de1b15d801bfe7b
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Fri Oct 24 17:22:20 2008 +0100

    bitbake-dev: Remove implicit task from generateDepTree/generateDotGraphFiles
    
    Remove the implicit (from configuration.cmd) command/task for these events 
and
    instead use a parameter so that the task is given explicitly.

commit 22a326547dfd80b585fa7e4ecedcdb25d54a5a86
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Fri Oct 24 16:58:59 2008 +0100

    bitbake-dev: Make the "buildFile" command use the task parameter
    
    The "buildFile" command has a task parameter use it place of
    self.configuration.cmd when adding to the runqueue.

commit c790192322c9c3ed98b13395d4980d88d394c3ff
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Fri Oct 24 16:54:35 2008 +0100

    bitbake-dev: Make the task a parameter of the "tryBuild" command
    
    And switch the runqueue to use this rather than keeping it in the
    self.configuration.cmd variable

commit 2684070ac631787171a06926d324391756e6956b
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Fri Oct 24 16:22:19 2008 +0100

    bitbake-dev: Include target/command (from -c) in "buildTargets" command
    
    This allows a UI to read / control which task for the given targets is used.
    This makes it more consistent with the "buildFile" command.


Diff in this email is a maximum of 400 lines.
diff --git a/bitbake-dev/lib/bb/command.py b/bitbake-dev/lib/bb/command.py
index 0d4ef42..b947566 100644
--- a/bitbake-dev/lib/bb/command.py
+++ b/bitbake-dev/lib/bb/command.py
@@ -155,16 +155,18 @@ class CommandsAsync:
         Build a set of targets
         """
         pkgs_to_build = params[0]
+        task = params[1]
 
-        command.cooker.buildTargets(pkgs_to_build)
+        command.cooker.buildTargets(pkgs_to_build, task)
 
     def generateDepTreeEvent(self, command, params):
         """
         Generate an event containing the dependency information
         """
         pkgs_to_build = params[0]
+        task = params[1]
 
-        command.cooker.generateDepTreeEvent(pkgs_to_build)
+        command.cooker.generateDepTreeEvent(pkgs_to_build, task)
         command.finishAsyncCommand()
 
     def generateDotGraph(self, command, params):
@@ -172,8 +174,9 @@ class CommandsAsync:
         Dump dependency information to disk as .dot files
         """
         pkgs_to_build = params[0]
+        task = params[1]
 
-        command.cooker.generateDotGraphFiles(pkgs_to_build)
+        command.cooker.generateDotGraphFiles(pkgs_to_build, task)
         command.finishAsyncCommand()
 
     def showVersions(self, command, params):
diff --git a/bitbake-dev/lib/bb/cooker.py b/bitbake-dev/lib/bb/cooker.py
index 339bb45..c9afadb 100644
--- a/bitbake-dev/lib/bb/cooker.py
+++ b/bitbake-dev/lib/bb/cooker.py
@@ -145,13 +145,13 @@ class BBCooker:
             self.commandlineAction = ["parseFiles"]
         elif self.configuration.dot_graph:
             if self.configuration.pkgs_to_build:
-                self.commandlineAction = ["generateDotGraph", 
self.configuration.pkgs_to_build]
+                self.commandlineAction = ["generateDotGraph", 
self.configuration.pkgs_to_build, self.configuration.cmd]
             else:
                 self.commandlineAction = None
                 bb.error("Please specify a package name for dependency graph 
generation.")
         else:
             if self.configuration.pkgs_to_build:
-                self.commandlineAction = ["buildTargets", 
self.configuration.pkgs_to_build]
+                self.commandlineAction = ["buildTargets", 
self.configuration.pkgs_to_build, self.configuration.cmd]
             else:
                 self.commandlineAction = None
                 bb.error("Nothing to do.  Use 'bitbake world' to build 
everything, or run 'bitbake --help' for usage information.")
@@ -195,7 +195,7 @@ class BBCooker:
             bb.msg.error(bb.msg.domain.Build, "%s event exception, aborting" % 
bb.event.getName(event))
             raise
 
-    def tryBuild(self, fn):
+    def tryBuild(self, fn, task):
         """
         Build a provider and its dependencies. 
         build_depends is a list of previous build dependencies (not runtime)
@@ -209,7 +209,7 @@ class BBCooker:
         #if bb.build.stamp_is_current('do_%s' % self.configuration.cmd, 
the_data):
         #    return True
 
-        return self.tryBuildPackage(fn, item, self.configuration.cmd, the_data)
+        return self.tryBuildPackage(fn, item, task, the_data)
 
     def showVersions(self):
 
@@ -302,7 +302,7 @@ class BBCooker:
             if data.getVarFlag( e, 'python', envdata ):
                 bb.msg.plain("\npython %s () {\n%s}\n" % (e, data.getVar(e, 
envdata, 1)))
 
-    def generateDepTreeData(self, pkgs_to_build):
+    def generateDepTreeData(self, pkgs_to_build, task):
         """
         Create a dependency tree of pkgs_to_build, returning the data.
         """
@@ -320,7 +320,7 @@ class BBCooker:
         runlist = []
         for k in pkgs_to_build:
             taskdata.add_provider(localdata, self.status, k)
-            runlist.append([k, "do_%s" % self.configuration.cmd])
+            runlist.append([k, "do_%s" % task])
         taskdata.add_unresolved(localdata, self.status)
 
         rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, 
taskdata, runlist)
@@ -390,21 +390,21 @@ class BBCooker:
         return depend_tree
 
 
-    def generateDepTreeEvent(self, pkgs_to_build):
+    def generateDepTreeEvent(self, pkgs_to_build, task):
         """
         Create a task dependency graph of pkgs_to_build.
         Generate an event with the result
         """
-        depgraph = self.generateDepTreeData(pkgs_to_build)
+        depgraph = self.generateDepTreeData(pkgs_to_build, task)
         bb.event.fire(bb.event.DepTreeGenerated(self.configuration.data, 
depgraph))
 
-    def generateDotGraphFiles(self, pkgs_to_build):
+    def generateDotGraphFiles(self, pkgs_to_build, task):
         """
         Create a task dependency graph of pkgs_to_build.
         Save the result to a set of .dot files.
         """
 
-        depgraph = self.generateDepTreeData(pkgs_to_build)
+        depgraph = self.generateDepTreeData(pkgs_to_build, task)
 
         # Prints a flattened form of package-depends below where subpackages 
of a package are merged into the main pn
         depends_file = file('pn-depends.dot', 'w' )
@@ -650,7 +650,7 @@ class BBCooker:
         bb.event.fire(bb.event.BuildStarted(buildname, [item], 
self.configuration.event_data))
 
         # Execute the runqueue
-        runlist = [[item, "do_%s" % self.configuration.cmd]]
+        runlist = [[item, "do_%s" % task]]
 
         rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, 
taskdata, runlist)
 
@@ -677,7 +677,7 @@ class BBCooker:
         self.cookerIdle = False
         self.server.register_idle_function(buildFileIdle, rq)
 
-    def buildTargets(self, targets):
+    def buildTargets(self, targets, task):
         """
         Attempt to build the targets specified
         """
@@ -721,7 +721,7 @@ class BBCooker:
         runlist = []
         for k in targets:
             taskdata.add_provider(localdata, self.status, k)
-            runlist.append([k, "do_%s" % self.configuration.cmd])
+            runlist.append([k, "do_%s" % task])
         taskdata.add_unresolved(localdata, self.status)
 
         rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, 
taskdata, runlist)
diff --git a/bitbake-dev/lib/bb/runqueue.py b/bitbake-dev/lib/bb/runqueue.py
index 1667205..1c911ef 100644
--- a/bitbake-dev/lib/bb/runqueue.py
+++ b/bitbake-dev/lib/bb/runqueue.py
@@ -993,10 +993,9 @@ class RunQueue:
                     os.setpgid(0, 0)
                     newsi = os.open('/dev/null', os.O_RDWR)
                     os.dup2(newsi, sys.stdin.fileno())
-                    self.cooker.configuration.cmd = taskname[3:]
                     bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, 
self.cooker.configuration.data)
                     try:
-                        self.cooker.tryBuild(fn)
+                        self.cooker.tryBuild(fn, taskname[3:])
                     except bb.build.EventException:
                         bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " 
" + taskname + " failed")
                         sys.exit(1)
diff --git a/bitbake-dev/lib/bb/shell.py b/bitbake-dev/lib/bb/shell.py
index 34828fe..55bae25 100644
--- a/bitbake-dev/lib/bb/shell.py
+++ b/bitbake-dev/lib/bb/shell.py
@@ -151,9 +151,6 @@ class BitBakeShellCommands:
         if len( names ) == 0: names = [ globexpr ]
         print "SHELL: Building %s" % ' '.join( names )
 
-        oldcmd = cooker.configuration.cmd
-        cooker.configuration.cmd = cmd
-
         td = taskdata.TaskData(cooker.configuration.abort)
         localdata = data.createCopy(cooker.configuration.data)
         data.update_data(localdata)
@@ -168,7 +165,7 @@ class BitBakeShellCommands:
                 if len(providers) == 0:
                     raise Providers.NoProvider
 
-                tasks.append([name, "do_%s" % cooker.configuration.cmd])
+                tasks.append([name, "do_%s" % cmd])
 
             td.add_unresolved(localdata, cooker.status)
             
@@ -189,7 +186,6 @@ class BitBakeShellCommands:
             print "ERROR: Couldn't build '%s'" % names
             last_exception = e
 
-        cooker.configuration.cmd = oldcmd
 
     build.usage = "<providee>"
 
@@ -240,18 +236,14 @@ class BitBakeShellCommands:
         bf = completeFilePath( name )
         print "SHELL: Calling '%s' on '%s'" % ( cmd, bf )
 
-        oldcmd = cooker.configuration.cmd
-        cooker.configuration.cmd = cmd
-
         try:
-            cooker.buildFile(bf)
+            cooker.buildFile(bf, cmd)
         except parse.ParseError:
             print "ERROR: Unable to open or parse '%s'" % bf
         except build.EventException, e:
             print "ERROR: Couldn't build '%s'" % name
             last_exception = e
 
-        cooker.configuration.cmd = oldcmd
     fileBuild.usage = "<bbfile>"
 
     def fileClean( self, params ):
diff --git a/bitbake-dev/lib/bb/ui/depexplorer.py 
b/bitbake-dev/lib/bb/ui/depexplorer.py
index becbb5d..9d92fa0 100644
--- a/bitbake-dev/lib/bb/ui/depexplorer.py
+++ b/bitbake-dev/lib/bb/ui/depexplorer.py
@@ -202,7 +202,7 @@ def init(server, eventHandler):
         if not cmdline or cmdline[0] != "generateDotGraph":
             print "This UI is only compatible with the -g option"
             return
-        ret = server.runCommand(["generateDepTreeEvent", cmdline[1]])
+        ret = server.runCommand(["generateDepTreeEvent", cmdline[1], 
cmdline[2]])
         if ret != True:
             print "Couldn't run command! %s" % ret
             return
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to