diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-04-25 11:16:29 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-06 10:12:16 +0100 |
| commit | be49d0ad572ef8d05467ee2c5774774c5b7f3fe2 (patch) | |
| tree | 3cfb8abc3b1e3697b18d3dff795a1ac3db5e2200 | |
| parent | b5af50e02480b96532959306e77778bd01021557 (diff) | |
| download | poky-be49d0ad572ef8d05467ee2c5774774c5b7f3fe2.tar.gz | |
bitbake: bitake: main: fix line-too-long pytling warnings
Wrapped long lines to fix "Line too long" pylint warnings.
(Bitbake rev: e329a932e14d002a561245b5026f974897f64598)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | bitbake/lib/bb/main.py | 121 |
1 files changed, 82 insertions, 39 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 3978a1bc3c..60c7da3ec7 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
| @@ -103,8 +103,9 @@ def import_extension_module(pkg, modulename, checkattr): | |||
| 103 | module = __import__(pkg.__name__, fromlist=[modulename]) | 103 | module = __import__(pkg.__name__, fromlist=[modulename]) |
| 104 | return getattr(module, modulename) | 104 | return getattr(module, modulename) |
| 105 | except AttributeError: | 105 | except AttributeError: |
| 106 | raise BBMainException('FATAL: Unable to import extension module "%s" from %s. Valid extension modules: %s' % (modulename, pkg.__name__, present_options(list_extension_modules(pkg, checkattr)))) | 106 | modules = present_options(list_extension_modules(pkg, checkattr)) |
| 107 | 107 | raise BBMainException('FATAL: Unable to import extension module "%s" from %s. ' | |
| 108 | 'Valid extension modules: %s' % (modulename, pkg.__name__, modules)) | ||
| 108 | 109 | ||
| 109 | # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" | 110 | # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" |
| 110 | warnlog = logging.getLogger("BitBake.Warnings") | 111 | warnlog = logging.getLogger("BitBake.Warnings") |
| @@ -138,21 +139,32 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
| 138 | will provide the layer, BBFILES and other configuration information.""") | 139 | will provide the layer, BBFILES and other configuration information.""") |
| 139 | 140 | ||
| 140 | parser.add_option("-b", "--buildfile", action="store", dest="buildfile", default=None, | 141 | parser.add_option("-b", "--buildfile", action="store", dest="buildfile", default=None, |
| 141 | help="Execute tasks from a specific .bb recipe directly. WARNING: Does not handle any dependencies from other recipes.") | 142 | help="Execute tasks from a specific .bb recipe directly. WARNING: Does " |
| 143 | "not handle any dependencies from other recipes.") | ||
| 144 | |||
| 142 | parser.add_option("-k", "--continue", action="store_false", dest="abort", default=True, | 145 | parser.add_option("-k", "--continue", action="store_false", dest="abort", default=True, |
| 143 | help="Continue as much as possible after an error. While the target that failed and anything depending on it cannot be built, as much as possible will be built before stopping.") | 146 | help="Continue as much as possible after an error. While the target that " |
| 147 | "failed and anything depending on it cannot be built, as much as " | ||
| 148 | "possible will be built before stopping.") | ||
| 144 | 149 | ||
| 145 | parser.add_option("-a", "--tryaltconfigs", action="store_true", dest="tryaltconfigs", default=False, | 150 | parser.add_option("-a", "--tryaltconfigs", action="store_true", |
| 146 | help="Continue with builds by trying to use alternative providers where possible.") | 151 | dest="tryaltconfigs", default=False, |
| 152 | help="Continue with builds by trying to use alternative providers " | ||
| 153 | "where possible.") | ||
| 147 | 154 | ||
| 148 | parser.add_option("-f", "--force", action="store_true", dest="force", default=False, | 155 | parser.add_option("-f", "--force", action="store_true", dest="force", default=False, |
| 149 | help="Force the specified targets/task to run (invalidating any existing stamp file).") | 156 | help="Force the specified targets/task to run (invalidating any " |
| 157 | "existing stamp file).") | ||
| 150 | 158 | ||
| 151 | parser.add_option("-c", "--cmd", action="store", dest="cmd", | 159 | parser.add_option("-c", "--cmd", action="store", dest="cmd", |
| 152 | help="Specify the task to execute. The exact options available depend on the metadata. Some examples might be 'compile' or 'populate_sysroot' or 'listtasks' may give a list of the tasks available.") | 160 | help="Specify the task to execute. The exact options available " |
| 161 | "depend on the metadata. Some examples might be 'compile'" | ||
| 162 | " or 'populate_sysroot' or 'listtasks' may give a list of " | ||
| 163 | "the tasks available.") | ||
| 153 | 164 | ||
| 154 | parser.add_option("-C", "--clear-stamp", action="store", dest="invalidate_stamp", | 165 | parser.add_option("-C", "--clear-stamp", action="store", dest="invalidate_stamp", |
| 155 | help="Invalidate the stamp for the specified task such as 'compile' and then run the default task for the specified target(s).") | 166 | help="Invalidate the stamp for the specified task such as 'compile' " |
| 167 | "and then run the default task for the specified target(s).") | ||
| 156 | 168 | ||
| 157 | parser.add_option("-r", "--read", action="append", dest="prefile", default=[], | 169 | parser.add_option("-r", "--read", action="append", dest="prefile", default=[], |
| 158 | help="Read the specified file before bitbake.conf.") | 170 | help="Read the specified file before bitbake.conf.") |
| @@ -171,31 +183,44 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
| 171 | 183 | ||
| 172 | parser.add_option("-S", "--dump-signatures", action="append", dest="dump_signatures", | 184 | parser.add_option("-S", "--dump-signatures", action="append", dest="dump_signatures", |
| 173 | default=[], metavar="SIGNATURE_HANDLER", | 185 | default=[], metavar="SIGNATURE_HANDLER", |
| 174 | help="Dump out the signature construction information, with no task execution. The SIGNATURE_HANDLER parameter is passed to the handler. Two common values are none and printdiff but the handler may define more/less. none means only dump the signature, printdiff means compare the dumped signature with the cached one.") | 186 | help="Dump out the signature construction information, with no task " |
| 175 | 187 | "execution. The SIGNATURE_HANDLER parameter is passed to the " | |
| 176 | parser.add_option("-p", "--parse-only", action="store_true", dest="parse_only", default=False, | 188 | "handler. Two common values are none and printdiff but the handler " |
| 189 | "may define more/less. none means only dump the signature, printdiff" | ||
| 190 | " means compare the dumped signature with the cached one.") | ||
| 191 | |||
| 192 | parser.add_option("-p", "--parse-only", action="store_true", | ||
| 193 | dest="parse_only", default=False, | ||
| 177 | help="Quit after parsing the BB recipes.") | 194 | help="Quit after parsing the BB recipes.") |
| 178 | 195 | ||
| 179 | parser.add_option("-s", "--show-versions", action="store_true", dest="show_versions", default=False, | 196 | parser.add_option("-s", "--show-versions", action="store_true", |
| 197 | dest="show_versions", default=False, | ||
| 180 | help="Show current and preferred versions of all recipes.") | 198 | help="Show current and preferred versions of all recipes.") |
| 181 | 199 | ||
| 182 | parser.add_option("-e", "--environment", action="store_true", dest="show_environment", default=False, | 200 | parser.add_option("-e", "--environment", action="store_true", |
| 183 | help="Show the global or per-recipe environment complete with information about where variables were set/changed.") | 201 | dest="show_environment", default=False, |
| 202 | help="Show the global or per-recipe environment complete with information" | ||
| 203 | " about where variables were set/changed.") | ||
| 184 | 204 | ||
| 185 | parser.add_option("-g", "--graphviz", action="store_true", dest="dot_graph", default=False, | 205 | parser.add_option("-g", "--graphviz", action="store_true", dest="dot_graph", default=False, |
| 186 | help="Save dependency tree information for the specified targets in the dot syntax.") | 206 | help="Save dependency tree information for the specified " |
| 207 | "targets in the dot syntax.") | ||
| 187 | 208 | ||
| 188 | parser.add_option("-I", "--ignore-deps", action="append", dest="extra_assume_provided", default=[], | 209 | parser.add_option("-I", "--ignore-deps", action="append", |
| 189 | help="""Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""") | 210 | dest="extra_assume_provided", default=[], |
| 211 | help="Assume these dependencies don't exist and are already provided " | ||
| 212 | "(equivalent to ASSUME_PROVIDED). Useful to make dependency " | ||
| 213 | "graphs more appealing") | ||
| 190 | 214 | ||
| 191 | parser.add_option("-l", "--log-domains", action="append", dest="debug_domains", default=[], | 215 | parser.add_option("-l", "--log-domains", action="append", dest="debug_domains", default=[], |
| 192 | help="""Show debug logging for the specified logging domains""") | 216 | help="Show debug logging for the specified logging domains") |
| 193 | 217 | ||
| 194 | parser.add_option("-P", "--profile", action="store_true", dest="profile", default=False, | 218 | parser.add_option("-P", "--profile", action="store_true", dest="profile", default=False, |
| 195 | help="Profile the command and save reports.") | 219 | help="Profile the command and save reports.") |
| 196 | 220 | ||
| 197 | # @CHOICES@ is substituted out by BitbakeHelpFormatter above | 221 | # @CHOICES@ is substituted out by BitbakeHelpFormatter above |
| 198 | parser.add_option("-u", "--ui", action="store", dest="ui", default=os.environ.get('BITBAKE_UI', 'knotty'), | 222 | parser.add_option("-u", "--ui", action="store", dest="ui", |
| 223 | default=os.environ.get('BITBAKE_UI', 'knotty'), | ||
| 199 | help="The user interface to use (@CHOICES@ - default %default).") | 224 | help="The user interface to use (@CHOICES@ - default %default).") |
| 200 | 225 | ||
| 201 | # @CHOICES@ is substituted out by BitbakeHelpFormatter above | 226 | # @CHOICES@ is substituted out by BitbakeHelpFormatter above |
| @@ -203,40 +228,53 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
| 203 | default=["process", "xmlrpc"]["BBSERVER" in os.environ], | 228 | default=["process", "xmlrpc"]["BBSERVER" in os.environ], |
| 204 | help="Choose which server type to use (@CHOICES@ - default %default).") | 229 | help="Choose which server type to use (@CHOICES@ - default %default).") |
| 205 | 230 | ||
| 206 | parser.add_option("", "--token", action="store", dest="xmlrpctoken", default=os.environ.get("BBTOKEN"), | 231 | parser.add_option("", "--token", action="store", dest="xmlrpctoken", |
| 207 | help="Specify the connection token to be used when connecting to a remote server.") | 232 | default=os.environ.get("BBTOKEN"), |
| 233 | help="Specify the connection token to be used when connecting " | ||
| 234 | "to a remote server.") | ||
| 208 | 235 | ||
| 209 | parser.add_option("", "--revisions-changed", action="store_true", dest="revisions_changed", default=False, | 236 | parser.add_option("", "--revisions-changed", action="store_true", |
| 210 | help="Set the exit code depending on whether upstream floating revisions have changed or not.") | 237 | dest="revisions_changed", default=False, |
| 238 | help="Set the exit code depending on whether upstream floating " | ||
| 239 | "revisions have changed or not.") | ||
| 211 | 240 | ||
| 212 | parser.add_option("", "--server-only", action="store_true", dest="server_only", default=False, | 241 | parser.add_option("", "--server-only", action="store_true", |
| 213 | help="Run bitbake without a UI, only starting a server (cooker) process.") | 242 | dest="server_only", default=False, |
| 243 | help="Run bitbake without a UI, only starting a server " | ||
| 244 | "(cooker) process.") | ||
| 214 | 245 | ||
| 215 | parser.add_option("-B", "--bind", action="store", dest="bind", default=False, | 246 | parser.add_option("-B", "--bind", action="store", dest="bind", default=False, |
| 216 | help="The name/address for the bitbake server to bind to.") | 247 | help="The name/address for the bitbake server to bind to.") |
| 217 | 248 | ||
| 218 | parser.add_option("", "--no-setscene", action="store_true", dest="nosetscene", default=False, | 249 | parser.add_option("", "--no-setscene", action="store_true", |
| 219 | help="Do not run any setscene tasks. sstate will be ignored and everything needed, built.") | 250 | dest="nosetscene", default=False, |
| 251 | help="Do not run any setscene tasks. sstate will be ignored and " | ||
| 252 | "everything needed, built.") | ||
| 220 | 253 | ||
| 221 | parser.add_option("", "--setscene-only", action="store_true", dest="setsceneonly", default=False, | 254 | parser.add_option("", "--setscene-only", action="store_true", |
| 255 | dest="setsceneonly", default=False, | ||
| 222 | help="Only run setscene tasks, don't run any real tasks.") | 256 | help="Only run setscene tasks, don't run any real tasks.") |
| 223 | 257 | ||
| 224 | parser.add_option("", "--remote-server", action="store", dest="remote_server", | 258 | parser.add_option("", "--remote-server", action="store", dest="remote_server", |
| 225 | default=os.environ.get("BBSERVER"), | 259 | default=os.environ.get("BBSERVER"), |
| 226 | help="Connect to the specified server.") | 260 | help="Connect to the specified server.") |
| 227 | 261 | ||
| 228 | parser.add_option("-m", "--kill-server", action="store_true", dest="kill_server", default=False, | 262 | parser.add_option("-m", "--kill-server", action="store_true", |
| 263 | dest="kill_server", default=False, | ||
| 229 | help="Terminate the remote server.") | 264 | help="Terminate the remote server.") |
| 230 | 265 | ||
| 231 | parser.add_option("", "--observe-only", action="store_true", dest="observe_only", default=False, | 266 | parser.add_option("", "--observe-only", action="store_true", |
| 267 | dest="observe_only", default=False, | ||
| 232 | help="Connect to a server as an observing-only client.") | 268 | help="Connect to a server as an observing-only client.") |
| 233 | 269 | ||
| 234 | parser.add_option("", "--status-only", action="store_true", dest="status_only", default=False, | 270 | parser.add_option("", "--status-only", action="store_true", |
| 271 | dest="status_only", default=False, | ||
| 235 | help="Check the status of the remote bitbake server.") | 272 | help="Check the status of the remote bitbake server.") |
| 236 | 273 | ||
| 237 | parser.add_option("-w", "--write-log", action="store", dest="writeeventlog", | 274 | parser.add_option("-w", "--write-log", action="store", dest="writeeventlog", |
| 238 | default=os.environ.get("BBEVENTLOG"), | 275 | default=os.environ.get("BBEVENTLOG"), |
| 239 | help="Writes the event log of the build to a bitbake event json file. Use '' (empty string) to assign the name automatically.") | 276 | help="Writes the event log of the build to a bitbake event json file. " |
| 277 | "Use '' (empty string) to assign the name automatically.") | ||
| 240 | 278 | ||
| 241 | options, targets = parser.parse_args(argv) | 279 | options, targets = parser.parse_args(argv) |
| 242 | 280 | ||
| @@ -249,8 +287,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
| 249 | 287 | ||
| 250 | # fill in proper log name if not supplied | 288 | # fill in proper log name if not supplied |
| 251 | if options.writeeventlog is not None and len(options.writeeventlog) == 0: | 289 | if options.writeeventlog is not None and len(options.writeeventlog) == 0: |
| 252 | import datetime | 290 | from datetime import datetime |
| 253 | options.writeeventlog = "bitbake_eventlog_%s.json" % datetime.datetime.now().strftime("%Y%m%d%H%M%S") | 291 | eventlog = "bitbake_eventlog_%s.json" % datetime.now().strftime("%Y%m%d%H%M%S") |
| 292 | options.writeeventlog = eventlog | ||
| 254 | 293 | ||
| 255 | # if BBSERVER says to autodetect, let's do that | 294 | # if BBSERVER says to autodetect, let's do that |
| 256 | if options.remote_server: | 295 | if options.remote_server: |
| @@ -360,7 +399,8 @@ def bitbake_main(configParams, configuration): | |||
| 360 | "connecting to a server.\n") | 399 | "connecting to a server.\n") |
| 361 | 400 | ||
| 362 | if configParams.kill_server and not configParams.remote_server: | 401 | if configParams.kill_server and not configParams.remote_server: |
| 363 | raise BBMainException("FATAL: '--kill-server' can only be used to terminate a remote server") | 402 | raise BBMainException("FATAL: '--kill-server' can only be used to " |
| 403 | "terminate a remote server") | ||
| 364 | 404 | ||
| 365 | if "BBDEBUG" in os.environ: | 405 | if "BBDEBUG" in os.environ: |
| 366 | level = int(os.environ["BBDEBUG"]) | 406 | level = int(os.environ["BBDEBUG"]) |
| @@ -397,7 +437,8 @@ def bitbake_main(configParams, configuration): | |||
| 397 | bb.event.ui_queue = [] | 437 | bb.event.ui_queue = [] |
| 398 | else: | 438 | else: |
| 399 | # we start a stub server that is actually a XMLRPClient that connects to a real server | 439 | # we start a stub server that is actually a XMLRPClient that connects to a real server |
| 400 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only, configParams.xmlrpctoken) | 440 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only, |
| 441 | configParams.xmlrpctoken) | ||
| 401 | server.saveConnectionDetails(configParams.remote_server) | 442 | server.saveConnectionDetails(configParams.remote_server) |
| 402 | 443 | ||
| 403 | 444 | ||
| @@ -426,12 +467,14 @@ def bitbake_main(configParams, configuration): | |||
| 426 | return 0 | 467 | return 0 |
| 427 | 468 | ||
| 428 | try: | 469 | try: |
| 429 | return ui_module.main(server_connection.connection, server_connection.events, configParams) | 470 | return ui_module.main(server_connection.connection, server_connection.events, |
| 471 | configParams) | ||
| 430 | finally: | 472 | finally: |
| 431 | bb.event.ui_queue = [] | 473 | bb.event.ui_queue = [] |
| 432 | server_connection.terminate() | 474 | server_connection.terminate() |
| 433 | else: | 475 | else: |
| 434 | print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host, server.serverImpl.port)) | 476 | print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host, |
| 477 | server.serverImpl.port)) | ||
| 435 | return 0 | 478 | return 0 |
| 436 | 479 | ||
| 437 | return 1 | 480 | return 1 |
