summaryrefslogtreecommitdiffstats
path: root/bin/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-24 16:56:12 -0700
committerChris Larson <chris_larson@mentor.com>2010-04-09 19:38:37 -0700
commit2caf134b43a44dad30af4fbe33033b3c58deee57 (patch)
treef0f72340efc339293efe2629864dc215b8576ba9 /bin/bitbake
parent297305b3742323d09d9ca58e958c4f18e945a148 (diff)
downloadbitbake-contrib-2caf134b43a44dad30af4fbe33033b3c58deee57.tar.gz
Formatting cleanups
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-xbin/bitbake98
1 files changed, 51 insertions, 47 deletions
diff --git a/bin/bitbake b/bin/bitbake
index 2a84692cf..35af7ff34 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -23,7 +23,8 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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'))
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
+ 'lib'))
import warnings
import bb
@@ -40,16 +41,18 @@ if sys.hexversion < 0x020600F0:
print "Sorry, python 2.6 or later is required for this version of bitbake"
sys.exit(1)
+
#============================================================================#
# BBOptions
#============================================================================#
-class BBConfiguration( object ):
+class BBConfiguration(object):
"""
Manages build options and configurations for one run
"""
- def __init__( self, options ):
+
+ def __init__(self, options):
for key, val in options.__dict__.items():
- setattr( self, key, val )
+ setattr(self, key, val)
self.pkgs_to_build = []
@@ -90,73 +93,74 @@ def main():
print "Sorry, bitbake needs python 2.5 or later."
sys.exit(1)
- parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ),
- usage = """%prog [options] [package ...]
+ parser = optparse.OptionParser(
+ version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
+ usage = """%prog [options] [package ...]
Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space separated list of files to
be executed. BBFILES does support wildcards.
-Default BBFILES are the .bb files in the current directory.""" )
+Default BBFILES are the .bb files in the current directory.""")
- parser.add_option( "-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.",
- action = "store", dest = "buildfile", default = None )
+ parser.add_option("-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.",
+ action = "store", dest = "buildfile", default = None)
- 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.",
- action = "store_false", dest = "abort", default = True )
+ 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.",
+ action = "store_false", dest = "abort", default = True)
- parser.add_option( "-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
- action = "store_true", dest = "tryaltconfigs", default = False )
+ parser.add_option("-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
+ action = "store_true", dest = "tryaltconfigs", default = False)
- parser.add_option( "-f", "--force", help = "force run of specified cmd, regardless of stamp status",
- action = "store_true", dest = "force", default = False )
+ parser.add_option("-f", "--force", help = "force run of specified cmd, regardless of stamp status",
+ action = "store_true", dest = "force", default = False)
- parser.add_option( "-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.",
- action = "store_true", dest = "interactive", default = False )
+ parser.add_option("-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.",
+ action = "store_true", dest = "interactive", default = False)
- 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",
- action = "store", dest = "cmd" )
+ 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",
+ action = "store", dest = "cmd")
- parser.add_option( "-r", "--read", help = "read the specified file before bitbake.conf",
- action = "append", dest = "file", default = [] )
+ parser.add_option("-r", "--read", help = "read the specified file before bitbake.conf",
+ action = "append", dest = "file", default = [])
- parser.add_option( "-v", "--verbose", help = "output more chit-chat to the terminal",
- action = "store_true", dest = "verbose", default = False )
+ parser.add_option("-v", "--verbose", help = "output more chit-chat to the terminal",
+ action = "store_true", dest = "verbose", default = False)
- parser.add_option( "-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
+ parser.add_option("-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
action = "count", dest="debug", default = 0)
- parser.add_option( "-n", "--dry-run", help = "don't execute, just go through the motions",
- action = "store_true", dest = "dry_run", default = False )
+ parser.add_option("-n", "--dry-run", help = "don't execute, just go through the motions",
+ action = "store_true", dest = "dry_run", default = False)
- parser.add_option( "-p", "--parse-only", help = "quit after parsing the BB files (developers only)",
- action = "store_true", dest = "parse_only", default = False )
+ parser.add_option("-p", "--parse-only", help = "quit after parsing the BB files (developers only)",
+ action = "store_true", dest = "parse_only", default = False)
- parser.add_option( "-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)",
- action = "store_true", dest = "disable_psyco", default = False )
+ parser.add_option("-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)",
+ action = "store_true", dest = "disable_psyco", default = False)
- parser.add_option( "-s", "--show-versions", help = "show current and preferred versions of all packages",
- action = "store_true", dest = "show_versions", default = False )
+ parser.add_option("-s", "--show-versions", help = "show current and preferred versions of all packages",
+ action = "store_true", dest = "show_versions", default = False)
- parser.add_option( "-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
- action = "store_true", dest = "show_environment", default = False )
+ parser.add_option("-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
+ action = "store_true", dest = "show_environment", default = False)
- parser.add_option( "-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
- action = "store_true", dest = "dot_graph", default = False )
+ parser.add_option("-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
+ action = "store_true", dest = "dot_graph", default = False)
- 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""",
- action = "append", dest = "extra_assume_provided", default = [] )
+ 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""",
+ action = "append", dest = "extra_assume_provided", default = [])
- parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
- action = "append", dest = "debug_domains", default = [] )
+ parser.add_option("-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
+ action = "append", dest = "debug_domains", default = [])
- parser.add_option( "-P", "--profile", help = "profile the command and print a report",
- action = "store_true", dest = "profile", default = False )
+ parser.add_option("-P", "--profile", help = "profile the command and print a report",
+ action = "store_true", dest = "profile", default = False)
- parser.add_option( "-u", "--ui", help = "userinterface to use",
+ parser.add_option("-u", "--ui", help = "userinterface to use",
action = "store", dest = "ui")
- parser.add_option( "", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
- action = "store_true", dest = "revisions_changed", default = False )
+ parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
+ action = "store_true", dest = "revisions_changed", default = False)
options, args = parser.parse_args(sys.argv)
@@ -168,7 +172,7 @@ Default BBFILES are the .bb files in the current directory.""" )
# 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_logfile = os.path.join(os.getcwd(), "cooker.log")
cooker = bb.cooker.BBCooker(configuration, server)
@@ -197,7 +201,7 @@ Default BBFILES are the .bb files in the current directory.""" )
# Dynamically load the UI based on the ui name. Although we
# suggest a fixed set this allows you to have flexibility in which
# ones are available.
- uimodule = __import__("bb.ui", fromlist=[ui])
+ uimodule = __import__("bb.ui", fromlist = [ui])
return_value = getattr(uimodule, ui).init(serverConnection.connection, serverConnection.events)
except AttributeError:
print "FATAL: Invalid user interface '%s' specified. " % ui