summaryrefslogtreecommitdiffstats
path: root/bitbake-dev/bin/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake-dev/bin/bitbake')
-rwxr-xr-xbitbake-dev/bin/bitbake195
1 files changed, 0 insertions, 195 deletions
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake
deleted file mode 100755
index 23c9d73ee4..0000000000
--- a/bitbake-dev/bin/bitbake
+++ /dev/null
@@ -1,195 +0,0 @@
1#!/usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (C) 2003, 2004 Chris Larson
6# Copyright (C) 2003, 2004 Phil Blundell
7# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
8# Copyright (C) 2005 Holger Hans Peter Freyther
9# Copyright (C) 2005 ROAD GmbH
10# Copyright (C) 2006 Richard Purdie
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License version 2 as
14# published by the Free Software Foundation.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License along
22# with this program; if not, write to the Free Software Foundation, Inc.,
23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25import sys, os, getopt, re, time, optparse, xmlrpclib
26sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
27import bb
28from bb import cooker
29from bb import ui
30
31
32__version__ = "1.9.0"
33
34if sys.hexversion < 0x020500F0:
35 print "Sorry, python 2.5 or later is required for this version of bitbake"
36 sys.exit(1)
37
38#============================================================================#
39# BBOptions
40#============================================================================#
41class BBConfiguration( object ):
42 """
43 Manages build options and configurations for one run
44 """
45 def __init__( self, options ):
46 for key, val in options.__dict__.items():
47 setattr( self, key, val )
48
49
50def print_exception(exc, value, tb):
51 """
52 Print the exception to stderr, only showing the traceback if bitbake
53 debugging is enabled.
54 """
55 if not bb.msg.debug_level['default']:
56 tb = None
57
58 sys.__excepthook__(exc, value, tb)
59
60
61#============================================================================#
62# main
63#============================================================================#
64
65def main():
66 return_value = 0
67 pythonver = sys.version_info
68 if pythonver[0] < 2 or (pythonver[0] == 2 and pythonver[1] < 5):
69 print "Sorry, bitbake needs python 2.5 or later."
70 sys.exit(1)
71
72 parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ),
73 usage = """%prog [options] [package ...]
74
75Executes the specified task (default is 'build') for a given set of BitBake files.
76It expects that BBFILES is defined, which is a space separated list of files to
77be executed. BBFILES does support wildcards.
78Default BBFILES are the .bb files in the current directory.""" )
79
80 parser.add_option( "-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.",
81 action = "store", dest = "buildfile", default = None )
82
83 parser.add_option( "-k", "--continue", help = "continue as much as possible after an error. While the target that failed, and those that depend on it, cannot be remade, the other dependencies of these targets can be processed all the same.",
84 action = "store_false", dest = "abort", default = True )
85
86 parser.add_option( "-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
87 action = "store_true", dest = "tryaltconfigs", default = False )
88
89 parser.add_option( "-f", "--force", help = "force run of specified cmd, regardless of stamp status",
90 action = "store_true", dest = "force", default = False )
91
92 parser.add_option( "-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.",
93 action = "store_true", dest = "interactive", default = False )
94
95 parser.add_option( "-c", "--cmd", help = "Specify task to execute. Note that this only executes the specified task for the providee and the packages it depends on, i.e. 'compile' does not implicitly call stage for the dependencies (IOW: use only if you know what you are doing). Depending on the base.bbclass a listtasks tasks is defined and will show available tasks",
96 action = "store", dest = "cmd" )
97
98 parser.add_option( "-r", "--read", help = "read the specified file before bitbake.conf",
99 action = "append", dest = "file", default = [] )
100
101 parser.add_option( "-v", "--verbose", help = "output more chit-chat to the terminal",
102 action = "store_true", dest = "verbose", default = False )
103
104 parser.add_option( "-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
105 action = "count", dest="debug", default = 0)
106
107 parser.add_option( "-n", "--dry-run", help = "don't execute, just go through the motions",
108 action = "store_true", dest = "dry_run", default = False )
109
110 parser.add_option( "-p", "--parse-only", help = "quit after parsing the BB files (developers only)",
111 action = "store_true", dest = "parse_only", default = False )
112
113 parser.add_option( "-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)",
114 action = "store_true", dest = "disable_psyco", default = False )
115
116 parser.add_option( "-s", "--show-versions", help = "show current and preferred versions of all packages",
117 action = "store_true", dest = "show_versions", default = False )
118
119 parser.add_option( "-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
120 action = "store_true", dest = "show_environment", default = False )
121
122 parser.add_option( "-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
123 action = "store_true", dest = "dot_graph", default = False )
124
125 parser.add_option( "-I", "--ignore-deps", help = """Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""",
126 action = "append", dest = "extra_assume_provided", default = [] )
127
128 parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
129 action = "append", dest = "debug_domains", default = [] )
130
131 parser.add_option( "-P", "--profile", help = "profile the command and print a report",
132 action = "store_true", dest = "profile", default = False )
133
134 parser.add_option( "-u", "--ui", help = "userinterface to use",
135 action = "store", dest = "ui")
136
137 parser.add_option( "", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
138 action = "store_true", dest = "revisions_changed", default = False )
139
140 options, args = parser.parse_args(sys.argv)
141
142 configuration = BBConfiguration(options)
143 configuration.pkgs_to_build = []
144 configuration.pkgs_to_build.extend(args[1:])
145
146 #server = bb.server.xmlrpc
147 server = bb.server.none
148
149 # Save a logfile for cooker into the current working directory. When the
150 # server is daemonized this logfile will be truncated.
151 cooker_logfile = os.path.join (os.getcwd(), "cooker.log")
152
153 cooker = bb.cooker.BBCooker(configuration, server)
154
155 # Clear away any spurious environment variables. But don't wipe the
156 # environment totally. This is necessary to ensure the correct operation
157 # of the UIs (e.g. for DISPLAY, etc.)
158 bb.utils.clean_environment()
159
160 cooker.parseCommandLine()
161
162 serverinfo = server.BitbakeServerInfo(cooker.server)
163
164 server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile)
165 del cooker
166
167 sys.excepthook = print_exception
168
169 # Setup a connection to the server (cooker)
170 serverConnection = server.BitBakeServerConnection(serverinfo)
171
172 # Launch the UI
173 if configuration.ui:
174 ui = configuration.ui
175 else:
176 ui = "knotty"
177
178 try:
179 # Dynamically load the UI based on the ui name. Although we
180 # suggest a fixed set this allows you to have flexibility in which
181 # ones are available.
182 exec "from bb.ui import " + ui
183 exec "return_value = " + ui + ".init(serverConnection.connection, serverConnection.events)"
184 except ImportError:
185 print "FATAL: Invalid user interface '%s' specified. " % ui
186 print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'."
187 except Exception, e:
188 print "FATAL: Unable to start to '%s' UI: %s." % (configuration.ui, e.message)
189 finally:
190 serverConnection.terminate()
191 return return_value
192
193if __name__ == "__main__":
194 ret = main()
195 sys.exit(ret)