This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 bitbake-dev/bin/bitbake      |   12 +++------
 bitbake-dev/lib/bb/cooker.py |   56 +++++++++++++++++++----------------------
 2 files changed, 30 insertions(+), 38 deletions(-)

New commits:
commit 0b6fdfb14d7de5d087055574beb3abfd7d9e6931
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Tue Oct 28 11:27:58 2008 +0000

    bitbake-dev: Refactor configuration file parsing
    
    Separate the parsing of the configuration files / recipes into a separate
    function to the parsing of the command line. This parsing of the 
configuration
    files now happens when updateCache() is called.
    
    Some functionality has been moved from parseConfiguration() to __init__.

commit 0b9da42bb5c2355fe6b2a71f3a4970ac46118caa
Author: Rob Bradford <[EMAIL PROTECTED]>
Date:   Tue Oct 28 11:09:51 2008 +0000

    bitbake-dev: Save the cooker log into the working directory.
    
    This is necessary since with later refactoring the TMPDIR variable will not 
be
    available at this point in time.


Diff in this email is a maximum of 400 lines.
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake
index d85135a..3e87825 100755
--- a/bitbake-dev/bin/bitbake
+++ b/bitbake-dev/bin/bitbake
@@ -130,17 +130,13 @@ Default BBFILES are the .bb files in the current 
directory.""" )
     # of the UIs (e.g. for DISPLAY, etc.)
     bb.utils.clean_environment()
 
-    cooker.parseConfiguration()
+    cooker.parseCommandLine()
     host = cooker.server.host
     port = cooker.server.port
 
-    # Save a logfile for cooker somewhere
-    t = bb.data.getVar('TMPDIR', cooker.configuration.data, True)
-    if not t:
-       bb.msg.fatal(bb.msg.domain.Build, "TMPDIR not set")
-    t = os.path.join(t, "cooker")
-    bb.mkdirhier(t)
-    cooker_logfile = "%s/log.cooker.%s" % (t, str(os.getpid()))
+    # Save a logfile for cooker into the current working directory. When the
+    # server is daemonized this logfile will be truncated.
+    cooker_logfile = os.path.join (os.getcwd(), "cooker.log")
 
     daemonize.createDaemon(cooker.serve, cooker_logfile)
     del cooker
diff --git a/bitbake-dev/lib/bb/cooker.py b/bitbake-dev/lib/bb/cooker.py
index c9afadb..6dde5de 100644
--- a/bitbake-dev/lib/bb/cooker.py
+++ b/bitbake-dev/lib/bb/cooker.py
@@ -86,10 +86,31 @@ class BBCooker:
 
         self.configuration.data = bb.data.init()
 
-    def parseConfiguration(self):
-
         bb.data.inheritFromOS(self.configuration.data)
 
+        # TOSTOP must not be set or our children will hang when they output
+        fd = sys.stdout.fileno()
+        if os.isatty(fd):
+            import termios
+            tcattr = termios.tcgetattr(fd)
+            if tcattr[3] & termios.TOSTOP:
+                bb.msg.note(1, bb.msg.domain.Build, "The terminal had the 
TOSTOP bit set, clearing...")
+                tcattr[3] = tcattr[3] & ~termios.TOSTOP
+                termios.tcsetattr(fd, termios.TCSANOW, tcattr)
+
+        self.command = bb.command.Command(self)
+        self.cookerIdle = True
+        self.cookerState = cookerClean
+        self.cookerAction = cookerRun
+        self.server.register_idle_function(self.runCommands, self)
+
+    def parseConfiguration(self):
+        #
+        # Special updated configuration we use for firing events
+        #
+        self.configuration.event_data = 
bb.data.createCopy(self.configuration.data)
+        bb.data.update_data(self.configuration.event_data)
+
         for f in self.configuration.file:
             self.parseConfigurationFile( f )
 
@@ -102,29 +123,14 @@ class BBCooker:
         if bbpkgs:
             self.configuration.pkgs_to_build.extend(bbpkgs.split())
 
-        #
-        # Special updated configuration we use for firing events
-        #
-        self.configuration.event_data = 
bb.data.createCopy(self.configuration.data)
-        bb.data.update_data(self.configuration.event_data)
-
-        # TOSTOP must not be set or our children will hang when they output
-        fd = sys.stdout.fileno()
-        if os.isatty(fd):
-            import termios
-            tcattr = termios.tcgetattr(fd)
-            if tcattr[3] & termios.TOSTOP:
-                bb.msg.note(1, bb.msg.domain.Build, "The terminal had the 
TOSTOP bit set, clearing...")
-                tcattr[3] = tcattr[3] & ~termios.TOSTOP
-                termios.tcsetattr(fd, termios.TCSANOW, tcattr)
-
         # Change nice level if we're asked to
         nice = bb.data.getVar("BB_NICE_LEVEL", self.configuration.data, True)
         if nice:
             curnice = os.nice(0)
             nice = int(nice) - curnice
             bb.msg.note(2, bb.msg.domain.Build, "Renice to %s " % 
os.nice(nice))
- 
+
+    def parseCommandLine(self):
         # Parse any commandline into actions
         if self.configuration.show_environment:
             self.commandlineAction = None
@@ -156,17 +162,6 @@ class BBCooker:
                 self.commandlineAction = None
                 bb.error("Nothing to do.  Use 'bitbake world' to build 
everything, or run 'bitbake --help' for usage information.")
 
-        # FIXME - implement
-        #if self.configuration.interactive:
-        #    self.interactiveMode()
-
-        self.command = bb.command.Command(self)
-        self.cookerIdle = True
-        self.cookerState = cookerClean
-        self.cookerAction = cookerRun
-        self.server.register_idle_function(self.runCommands, self)
-
-
     def runCommands(self, server, data, abort):
         """
         Run any queued asynchronous command
@@ -731,6 +726,7 @@ class BBCooker:
 
     def updateCache(self):
 
+        self.parseConfiguration ()
         if self.cookerState == cookerParsed:
             return
 
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to