diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-19 14:48:19 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-19 14:48:19 +0000 |
commit | 22a271aaa99daeb6b29c42c2c1dc670bf204310e (patch) | |
tree | d2690b66e7a613820f34ceaecbce65809cbd22a3 /bitbake-dev/bin/bitbake | |
parent | cefe87fc3c4202e942f34666813bc094df2ffb4b (diff) | |
download | poky-22a271aaa99daeb6b29c42c2c1dc670bf204310e.tar.gz |
bitbake-dev: Sync with upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev/bin/bitbake')
-rwxr-xr-x | bitbake-dev/bin/bitbake | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake index cabdf2b452..33ae1b96e9 100755 --- a/bitbake-dev/bin/bitbake +++ b/bitbake-dev/bin/bitbake | |||
@@ -26,9 +26,8 @@ import sys, os, getopt, re, time, optparse, xmlrpclib | |||
26 | sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) | 26 | sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) |
27 | import bb | 27 | import bb |
28 | from bb import cooker | 28 | from bb import cooker |
29 | from bb import daemonize | ||
30 | from bb import ui | 29 | from bb import ui |
31 | from bb.ui import uievent | 30 | |
32 | 31 | ||
33 | __version__ = "1.9.0" | 32 | __version__ = "1.9.0" |
34 | 33 | ||
@@ -144,11 +143,14 @@ Default BBFILES are the .bb files in the current directory.""" ) | |||
144 | configuration.pkgs_to_build = [] | 143 | configuration.pkgs_to_build = [] |
145 | configuration.pkgs_to_build.extend(args[1:]) | 144 | configuration.pkgs_to_build.extend(args[1:]) |
146 | 145 | ||
146 | #server = bb.server.xmlrpc | ||
147 | server = bb.server.none | ||
148 | |||
147 | # Save a logfile for cooker into the current working directory. When the | 149 | # Save a logfile for cooker into the current working directory. When the |
148 | # server is daemonized this logfile will be truncated. | 150 | # server is daemonized this logfile will be truncated. |
149 | cooker_logfile = os.path.join (os.getcwd(), "cooker.log") | 151 | cooker_logfile = os.path.join (os.getcwd(), "cooker.log") |
150 | 152 | ||
151 | cooker = bb.cooker.BBCooker(configuration, bb.server.xmlrpc) | 153 | cooker = bb.cooker.BBCooker(configuration, server) |
152 | 154 | ||
153 | # Clear away any spurious environment variables. But don't wipe the | 155 | # Clear away any spurious environment variables. But don't wipe the |
154 | # environment totally. This is necessary to ensure the correct operation | 156 | # environment totally. This is necessary to ensure the correct operation |
@@ -157,19 +159,15 @@ Default BBFILES are the .bb files in the current directory.""" ) | |||
157 | 159 | ||
158 | cooker.parseCommandLine() | 160 | cooker.parseCommandLine() |
159 | 161 | ||
162 | serverinfo = server.BitbakeServerInfo(cooker.server) | ||
160 | 163 | ||
161 | 164 | server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile) | |
162 | |||
163 | host = cooker.server.host | ||
164 | port = cooker.server.port | ||
165 | |||
166 | daemonize.createDaemon(cooker.serve, cooker_logfile) | ||
167 | del cooker | 165 | del cooker |
168 | 166 | ||
167 | sys.excepthook = print_exception | ||
168 | |||
169 | # Setup a connection to the server (cooker) | 169 | # Setup a connection to the server (cooker) |
170 | server = xmlrpclib.Server("http://%s:%s" % (host, port), allow_none=True) | 170 | serverConnection = server.BitBakeServerConnection(serverinfo) |
171 | # Setup an event receiving queue | ||
172 | eventHandler = uievent.BBUIEventQueue(server) | ||
173 | 171 | ||
174 | # Launch the UI | 172 | # Launch the UI |
175 | if configuration.ui: | 173 | if configuration.ui: |
@@ -182,30 +180,16 @@ Default BBFILES are the .bb files in the current directory.""" ) | |||
182 | # suggest a fixed set this allows you to have flexibility in which | 180 | # suggest a fixed set this allows you to have flexibility in which |
183 | # ones are available. | 181 | # ones are available. |
184 | exec "from bb.ui import " + ui | 182 | exec "from bb.ui import " + ui |
185 | exec "return_value = " + ui + ".init(server, eventHandler)" | 183 | exec "return_value = " + ui + ".init(serverConnection.connection, serverConnection.events)" |
186 | except ImportError: | 184 | except ImportError: |
187 | print "FATAL: Invalid user interface '%s' specified. " % ui | 185 | print "FATAL: Invalid user interface '%s' specified. " % ui |
188 | print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'." | 186 | print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'." |
189 | except Exception, e: | 187 | except Exception, e: |
190 | print "FATAL: Unable to start to '%s' UI: %s." % (configuration.ui, e.message) | 188 | print "FATAL: Unable to start to '%s' UI: %s." % (configuration.ui, e.message) |
191 | finally: | 189 | finally: |
192 | # Don't wait for server indefinitely | 190 | serverConnection.terminate() |
193 | import socket | ||
194 | socket.setdefaulttimeout(2) | ||
195 | try: | ||
196 | eventHandler.system_quit() | ||
197 | except: | ||
198 | pass | ||
199 | try: | ||
200 | server.terminateServer() | ||
201 | except: | ||
202 | pass | ||
203 | return return_value | 191 | return return_value |
204 | 192 | ||
205 | if __name__ == "__main__": | 193 | if __name__ == "__main__": |
206 | print """WARNING, WARNING, WARNING | ||
207 | This is a Bitbake from the Unstable/Development 1.9 Branch. This software is a work in progress and should only be used by Bitbake developers/testers""" | ||
208 | |||
209 | ret = main() | 194 | ret = main() |
210 | sys.exit(ret) | 195 | sys.exit(ret) |
211 | |||