diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 09:34:12 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 11:37:26 +0100 |
commit | cd3c4292e7ccc8934f229fcf010f8615398b87b5 (patch) | |
tree | 0c9cbf81048e4b44bc613f78cd6d59f0d9400b2e /bitbake/bin | |
parent | e386fe4542865119ae7e1574e260c037e926239e (diff) | |
download | poky-cd3c4292e7ccc8934f229fcf010f8615398b87b5.tar.gz |
bitbake: Cleanup bitbake server init process to be clearer to follow
Create a standard format server class instance with method calls
for each step in the server setup. There should be enough hooks
for each of the different server types.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index acd086753f..8f2fece2ca 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -40,7 +40,7 @@ from bb import cooker | |||
40 | from bb import ui | 40 | from bb import ui |
41 | from bb import server | 41 | from bb import server |
42 | from bb.server import none | 42 | from bb.server import none |
43 | #from bb.server import xmlrpc | 43 | from bb.server import xmlrpc |
44 | 44 | ||
45 | __version__ = "1.13.0" | 45 | __version__ = "1.13.0" |
46 | logger = logging.getLogger("BitBake") | 46 | logger = logging.getLogger("BitBake") |
@@ -173,9 +173,6 @@ Default BBFILES are the .bb files in the current directory.""") | |||
173 | 173 | ||
174 | ui_main = get_ui(configuration) | 174 | ui_main = get_ui(configuration) |
175 | 175 | ||
176 | #server = bb.server.xmlrpc | ||
177 | server = bb.server.none | ||
178 | |||
179 | # Save a logfile for cooker into the current working directory. When the | 176 | # Save a logfile for cooker into the current working directory. When the |
180 | # server is daemonized this logfile will be truncated. | 177 | # server is daemonized this logfile will be truncated. |
181 | cooker_logfile = os.path.join(os.getcwd(), "cooker.log") | 178 | cooker_logfile = os.path.join(os.getcwd(), "cooker.log") |
@@ -192,21 +189,29 @@ Default BBFILES are the .bb files in the current directory.""") | |||
192 | # of the UIs (e.g. for DISPLAY, etc.) | 189 | # of the UIs (e.g. for DISPLAY, etc.) |
193 | bb.utils.clean_environment() | 190 | bb.utils.clean_environment() |
194 | 191 | ||
195 | cooker = bb.cooker.BBCooker(configuration, server) | 192 | #server = bb.server.xmlrpc.BitBakeServer() |
193 | server = bb.server.none.BitBakeServer() | ||
194 | |||
195 | server.initServer() | ||
196 | idle = server.getServerIdleCB() | ||
197 | |||
198 | cooker = bb.cooker.BBCooker(configuration, idle) | ||
196 | cooker.parseCommandLine() | 199 | cooker.parseCommandLine() |
197 | 200 | ||
198 | serverinfo = server.BitbakeServerInfo(cooker.server) | 201 | server.addcooker(cooker) |
202 | server.saveConnectionDetails() | ||
203 | server.detach(cooker_logfile) | ||
199 | 204 | ||
200 | server.BitBakeServerFork(cooker, cooker.server, serverinfo, cooker_logfile) | 205 | # Should no longer need to ever reference cooker |
201 | del cooker | 206 | del cooker |
202 | 207 | ||
203 | logger.removeHandler(handler) | 208 | logger.removeHandler(handler) |
204 | 209 | ||
205 | # Setup a connection to the server (cooker) | 210 | # Setup a connection to the server (cooker) |
206 | server_connection = server.BitBakeServerConnection(serverinfo) | 211 | server_connection = server.establishConnection() |
207 | 212 | ||
208 | try: | 213 | try: |
209 | return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events) | 214 | return server.launchUI(ui_main, server_connection.connection, server_connection.events) |
210 | finally: | 215 | finally: |
211 | server_connection.terminate() | 216 | server_connection.terminate() |
212 | 217 | ||