summaryrefslogtreecommitdiff
path: root/bitbake-dev/bin/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake-dev/bin/bitbake')
-rwxr-xr-xbitbake-dev/bin/bitbake40
1 files changed, 12 insertions, 28 deletions
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake
index cabdf2b45..33ae1b96e 100755
--- a/bitbake-dev/bin/bitbake
+++ b/bitbake-dev/bin/bitbake
@@ -26,9 +26,8 @@ import sys, os, getopt, re, time, optparse, xmlrpclib
sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
import bb
from bb import cooker
-from bb import daemonize
from bb import ui
-from bb.ui import uievent
+
__version__ = "1.9.0"
@@ -144,11 +143,14 @@ Default BBFILES are the .bb files in the current directory.""" )
configuration.pkgs_to_build = []
configuration.pkgs_to_build.extend(args[1:])
+ #server = bb.server.xmlrpc
+ server = bb.server.none
+
# 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")
- cooker = bb.cooker.BBCooker(configuration, bb.server.xmlrpc)
+ cooker = bb.cooker.BBCooker(configuration, server)
# Clear away any spurious environment variables. But don't wipe the
# environment totally. This is necessary to ensure the correct operation
@@ -157,19 +159,15 @@ Default BBFILES are the .bb files in the current directory.""" )
cooker.parseCommandLine()
+ serverinfo = server.BitbakeServerInfo(cooker.server)
-
-
- host = cooker.server.host
- port = cooker.server.port
-
- daemonize.createDaemon(cooker.serve, cooker_logfile)
+ server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile)
del cooker
+ sys.excepthook = print_exception
+
# Setup a connection to the server (cooker)
- server = xmlrpclib.Server("http://%s:%s" % (host, port), allow_none=True)
- # Setup an event receiving queue
- eventHandler = uievent.BBUIEventQueue(server)
+ serverConnection = server.BitBakeServerConnection(serverinfo)
# Launch the UI
if configuration.ui:
@@ -182,30 +180,16 @@ Default BBFILES are the .bb files in the current directory.""" )
# suggest a fixed set this allows you to have flexibility in which
# ones are available.
exec "from bb.ui import " + ui
- exec "return_value = " + ui + ".init(server, eventHandler)"
+ exec "return_value = " + ui + ".init(serverConnection.connection, serverConnection.events)"
except ImportError:
print "FATAL: Invalid user interface '%s' specified. " % ui
print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'."
except Exception, e:
print "FATAL: Unable to start to '%s' UI: %s." % (configuration.ui, e.message)
finally:
- # Don't wait for server indefinitely
- import socket
- socket.setdefaulttimeout(2)
- try:
- eventHandler.system_quit()
- except:
- pass
- try:
- server.terminateServer()
- except:
- pass
+ serverConnection.terminate()
return return_value
if __name__ == "__main__":
- print """WARNING, WARNING, WARNING
-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"""
-
ret = main()
sys.exit(ret)
-