diff options
| author | Chris Laplante <chris.laplante@agilent.com> | 2025-01-12 09:53:58 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-20 13:38:59 +0000 |
| commit | b44cfce570af60ca716c3c53ea627745078a045b (patch) | |
| tree | ecc5134962eaf53c2808d2d1a0b5007d5a832f9d /scripts/devtool | |
| parent | 8a46267032ba8ea8845b39b2c7b366d068e24e57 (diff) | |
| download | poky-b44cfce570af60ca716c3c53ea627745078a045b.tar.gz | |
devtool: misc cleanups
1. Bad None comparison
2. Reliance on transitive includes in bb
3. Unbound 'ret' variable
(From OE-Core rev: 0966d04c740f11da41c342a2a2d160d9ec5f5d70)
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/devtool')
| -rwxr-xr-x | scripts/devtool | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/devtool b/scripts/devtool index 596fdaac66..d29faf0238 100755 --- a/scripts/devtool +++ b/scripts/devtool | |||
| @@ -45,7 +45,7 @@ class ConfigHandler: | |||
| 45 | try: | 45 | try: |
| 46 | ret = self.config_obj.get(section, option) | 46 | ret = self.config_obj.get(section, option) |
| 47 | except (configparser.NoOptionError, configparser.NoSectionError): | 47 | except (configparser.NoOptionError, configparser.NoSectionError): |
| 48 | if default != None: | 48 | if default is not None: |
| 49 | ret = default | 49 | ret = default |
| 50 | else: | 50 | else: |
| 51 | raise | 51 | raise |
| @@ -147,7 +147,7 @@ def create_workspace(args, config, basepath, workspace): | |||
| 147 | _enable_workspace_layer(workspacedir, config, basepath) | 147 | _enable_workspace_layer(workspacedir, config, basepath) |
| 148 | 148 | ||
| 149 | def _create_workspace(workspacedir, config, basepath, layerseries=None): | 149 | def _create_workspace(workspacedir, config, basepath, layerseries=None): |
| 150 | import bb | 150 | import bb.utils |
| 151 | 151 | ||
| 152 | confdir = os.path.join(workspacedir, 'conf') | 152 | confdir = os.path.join(workspacedir, 'conf') |
| 153 | if os.path.exists(os.path.join(confdir, 'layer.conf')): | 153 | if os.path.exists(os.path.join(confdir, 'layer.conf')): |
| @@ -192,7 +192,7 @@ def _create_workspace(workspacedir, config, basepath, layerseries=None): | |||
| 192 | 192 | ||
| 193 | def _enable_workspace_layer(workspacedir, config, basepath): | 193 | def _enable_workspace_layer(workspacedir, config, basepath): |
| 194 | """Ensure the workspace layer is in bblayers.conf""" | 194 | """Ensure the workspace layer is in bblayers.conf""" |
| 195 | import bb | 195 | import bb.utils |
| 196 | bblayers_conf = os.path.join(basepath, 'conf', 'bblayers.conf') | 196 | bblayers_conf = os.path.join(basepath, 'conf', 'bblayers.conf') |
| 197 | if not os.path.exists(bblayers_conf): | 197 | if not os.path.exists(bblayers_conf): |
| 198 | logger.error('Unable to find bblayers.conf') | 198 | logger.error('Unable to find bblayers.conf') |
| @@ -286,6 +286,7 @@ def main(): | |||
| 286 | scriptutils.logger_setup_color(logger, global_args.color) | 286 | scriptutils.logger_setup_color(logger, global_args.color) |
| 287 | 287 | ||
| 288 | if global_args.bbpath is None: | 288 | if global_args.bbpath is None: |
| 289 | import bb | ||
| 289 | try: | 290 | try: |
| 290 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) | 291 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) |
| 291 | try: | 292 | try: |
| @@ -341,6 +342,7 @@ def main(): | |||
| 341 | ret = err.exitcode | 342 | ret = err.exitcode |
| 342 | except argparse_oe.ArgumentUsageError as ae: | 343 | except argparse_oe.ArgumentUsageError as ae: |
| 343 | parser.error_subcommand(ae.message, ae.subcommand) | 344 | parser.error_subcommand(ae.message, ae.subcommand) |
| 345 | ret = 2 | ||
| 344 | 346 | ||
| 345 | return ret | 347 | return ret |
| 346 | 348 | ||
