summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-24 16:56:12 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:32 +0100
commit7acc132cac873e60005516272473a55a8160b9c4 (patch)
tree2e4122862ffd856803160b6089fcb979d3efd630 /bitbake/bin
parentbbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff)
downloadpoky-7acc132cac873e60005516272473a55a8160b9c4.tar.gz
Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake98
1 files changed, 51 insertions, 47 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index b577e53895..ba84d2de7f 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -23,7 +23,8 @@
23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 24
25import sys, os, getopt, re, time, optparse, xmlrpclib 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')) 26sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
27 'lib'))
27 28
28import warnings 29import warnings
29import bb 30import bb
@@ -40,16 +41,18 @@ if sys.hexversion < 0x020600F0:
40 print "Sorry, python 2.6 or later is required for this version of bitbake" 41 print "Sorry, python 2.6 or later is required for this version of bitbake"
41 sys.exit(1) 42 sys.exit(1)
42 43
44
43#============================================================================# 45#============================================================================#
44# BBOptions 46# BBOptions
45#============================================================================# 47#============================================================================#
46class BBConfiguration( object ): 48class BBConfiguration(object):
47 """ 49 """
48 Manages build options and configurations for one run 50 Manages build options and configurations for one run
49 """ 51 """
50 def __init__( self, options ): 52
53 def __init__(self, options):
51 for key, val in options.__dict__.items(): 54 for key, val in options.__dict__.items():
52 setattr( self, key, val ) 55 setattr(self, key, val)
53 self.pkgs_to_build = [] 56 self.pkgs_to_build = []
54 57
55 58
@@ -90,73 +93,74 @@ def main():
90 print "Sorry, bitbake needs python 2.5 or later." 93 print "Sorry, bitbake needs python 2.5 or later."
91 sys.exit(1) 94 sys.exit(1)
92 95
93 parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ), 96 parser = optparse.OptionParser(
94 usage = """%prog [options] [package ...] 97 version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
98 usage = """%prog [options] [package ...]
95 99
96Executes the specified task (default is 'build') for a given set of BitBake files. 100Executes the specified task (default is 'build') for a given set of BitBake files.
97It expects that BBFILES is defined, which is a space separated list of files to 101It expects that BBFILES is defined, which is a space separated list of files to
98be executed. BBFILES does support wildcards. 102be executed. BBFILES does support wildcards.
99Default BBFILES are the .bb files in the current directory.""" ) 103Default BBFILES are the .bb files in the current directory.""")
100 104
101 parser.add_option( "-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.", 105 parser.add_option("-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.",
102 action = "store", dest = "buildfile", default = None ) 106 action = "store", dest = "buildfile", default = None)
103 107
104 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.", 108 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.",
105 action = "store_false", dest = "abort", default = True ) 109 action = "store_false", dest = "abort", default = True)
106 110
107 parser.add_option( "-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.", 111 parser.add_option("-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
108 action = "store_true", dest = "tryaltconfigs", default = False ) 112 action = "store_true", dest = "tryaltconfigs", default = False)
109 113
110 parser.add_option( "-f", "--force", help = "force run of specified cmd, regardless of stamp status", 114 parser.add_option("-f", "--force", help = "force run of specified cmd, regardless of stamp status",
111 action = "store_true", dest = "force", default = False ) 115 action = "store_true", dest = "force", default = False)
112 116
113 parser.add_option( "-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.", 117 parser.add_option("-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.",
114 action = "store_true", dest = "interactive", default = False ) 118 action = "store_true", dest = "interactive", default = False)
115 119
116 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", 120 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",
117 action = "store", dest = "cmd" ) 121 action = "store", dest = "cmd")
118 122
119 parser.add_option( "-r", "--read", help = "read the specified file before bitbake.conf", 123 parser.add_option("-r", "--read", help = "read the specified file before bitbake.conf",
120 action = "append", dest = "file", default = [] ) 124 action = "append", dest = "file", default = [])
121 125
122 parser.add_option( "-v", "--verbose", help = "output more chit-chat to the terminal", 126 parser.add_option("-v", "--verbose", help = "output more chit-chat to the terminal",
123 action = "store_true", dest = "verbose", default = False ) 127 action = "store_true", dest = "verbose", default = False)
124 128
125 parser.add_option( "-D", "--debug", help = "Increase the debug level. You can specify this more than once.", 129 parser.add_option("-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
126 action = "count", dest="debug", default = 0) 130 action = "count", dest="debug", default = 0)
127 131
128 parser.add_option( "-n", "--dry-run", help = "don't execute, just go through the motions", 132 parser.add_option("-n", "--dry-run", help = "don't execute, just go through the motions",
129 action = "store_true", dest = "dry_run", default = False ) 133 action = "store_true", dest = "dry_run", default = False)
130 134
131 parser.add_option( "-p", "--parse-only", help = "quit after parsing the BB files (developers only)", 135 parser.add_option("-p", "--parse-only", help = "quit after parsing the BB files (developers only)",
132 action = "store_true", dest = "parse_only", default = False ) 136 action = "store_true", dest = "parse_only", default = False)
133 137
134 parser.add_option( "-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)", 138 parser.add_option("-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)",
135 action = "store_true", dest = "disable_psyco", default = False ) 139 action = "store_true", dest = "disable_psyco", default = False)
136 140
137 parser.add_option( "-s", "--show-versions", help = "show current and preferred versions of all packages", 141 parser.add_option("-s", "--show-versions", help = "show current and preferred versions of all packages",
138 action = "store_true", dest = "show_versions", default = False ) 142 action = "store_true", dest = "show_versions", default = False)
139 143
140 parser.add_option( "-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)", 144 parser.add_option("-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
141 action = "store_true", dest = "show_environment", default = False ) 145 action = "store_true", dest = "show_environment", default = False)
142 146
143 parser.add_option( "-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax", 147 parser.add_option("-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
144 action = "store_true", dest = "dot_graph", default = False ) 148 action = "store_true", dest = "dot_graph", default = False)
145 149
146 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""", 150 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""",
147 action = "append", dest = "extra_assume_provided", default = [] ) 151 action = "append", dest = "extra_assume_provided", default = [])
148 152
149 parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""", 153 parser.add_option("-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
150 action = "append", dest = "debug_domains", default = [] ) 154 action = "append", dest = "debug_domains", default = [])
151 155
152 parser.add_option( "-P", "--profile", help = "profile the command and print a report", 156 parser.add_option("-P", "--profile", help = "profile the command and print a report",
153 action = "store_true", dest = "profile", default = False ) 157 action = "store_true", dest = "profile", default = False)
154 158
155 parser.add_option( "-u", "--ui", help = "userinterface to use", 159 parser.add_option("-u", "--ui", help = "userinterface to use",
156 action = "store", dest = "ui") 160 action = "store", dest = "ui")
157 161
158 parser.add_option( "", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not", 162 parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
159 action = "store_true", dest = "revisions_changed", default = False ) 163 action = "store_true", dest = "revisions_changed", default = False)
160 164
161 options, args = parser.parse_args(sys.argv) 165 options, args = parser.parse_args(sys.argv)
162 166
@@ -168,7 +172,7 @@ Default BBFILES are the .bb files in the current directory.""" )
168 172
169 # Save a logfile for cooker into the current working directory. When the 173 # Save a logfile for cooker into the current working directory. When the
170 # server is daemonized this logfile will be truncated. 174 # server is daemonized this logfile will be truncated.
171 cooker_logfile = os.path.join (os.getcwd(), "cooker.log") 175 cooker_logfile = os.path.join(os.getcwd(), "cooker.log")
172 176
173 bb.utils.init_logger(bb.msg, configuration.verbose, configuration.debug, 177 bb.utils.init_logger(bb.msg, configuration.verbose, configuration.debug,
174 configuration.debug_domains) 178 configuration.debug_domains)
@@ -200,7 +204,7 @@ Default BBFILES are the .bb files in the current directory.""" )
200 # Dynamically load the UI based on the ui name. Although we 204 # Dynamically load the UI based on the ui name. Although we
201 # suggest a fixed set this allows you to have flexibility in which 205 # suggest a fixed set this allows you to have flexibility in which
202 # ones are available. 206 # ones are available.
203 uimodule = __import__("bb.ui", fromlist=[ui]) 207 uimodule = __import__("bb.ui", fromlist = [ui])
204 return_value = getattr(uimodule, ui).init(serverConnection.connection, serverConnection.events) 208 return_value = getattr(uimodule, ui).init(serverConnection.connection, serverConnection.events)
205 except AttributeError: 209 except AttributeError:
206 print "FATAL: Invalid user interface '%s' specified. " % ui 210 print "FATAL: Invalid user interface '%s' specified. " % ui