diff options
Diffstat (limited to 'scripts/lib')
| -rw-r--r-- | scripts/lib/devtool/standard.py | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index e19812092e..769c3ce592 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -1314,24 +1314,10 @@ def status(args, config, basepath, workspace): | |||
| 1314 | return 0 | 1314 | return 0 |
| 1315 | 1315 | ||
| 1316 | 1316 | ||
| 1317 | def reset(args, config, basepath, workspace): | 1317 | def _reset(recipes, no_clean, config, basepath, workspace): |
| 1318 | """Entry point for the devtool 'reset' subcommand""" | 1318 | """Reset one or more recipes""" |
| 1319 | import bb | ||
| 1320 | if args.recipename: | ||
| 1321 | if args.all: | ||
| 1322 | raise DevtoolError("Recipe cannot be specified if -a/--all is used") | ||
| 1323 | else: | ||
| 1324 | for recipe in args.recipename: | ||
| 1325 | check_workspace_recipe(workspace, recipe, checksrc=False) | ||
| 1326 | elif not args.all: | ||
| 1327 | raise DevtoolError("Recipe must be specified, or specify -a/--all to " | ||
| 1328 | "reset all recipes") | ||
| 1329 | if args.all: | ||
| 1330 | recipes = list(workspace.keys()) | ||
| 1331 | else: | ||
| 1332 | recipes = args.recipename | ||
| 1333 | 1319 | ||
| 1334 | if recipes and not args.no_clean: | 1320 | if recipes and not no_clean: |
| 1335 | if len(recipes) == 1: | 1321 | if len(recipes) == 1: |
| 1336 | logger.info('Cleaning sysroot for recipe %s...' % recipes[0]) | 1322 | logger.info('Cleaning sysroot for recipe %s...' % recipes[0]) |
| 1337 | else: | 1323 | else: |
| @@ -1383,6 +1369,26 @@ def reset(args, config, basepath, workspace): | |||
| 1383 | # This is unlikely, but if it's empty we can just remove it | 1369 | # This is unlikely, but if it's empty we can just remove it |
| 1384 | os.rmdir(srctree) | 1370 | os.rmdir(srctree) |
| 1385 | 1371 | ||
| 1372 | |||
| 1373 | def reset(args, config, basepath, workspace): | ||
| 1374 | """Entry point for the devtool 'reset' subcommand""" | ||
| 1375 | import bb | ||
| 1376 | if args.recipename: | ||
| 1377 | if args.all: | ||
| 1378 | raise DevtoolError("Recipe cannot be specified if -a/--all is used") | ||
| 1379 | else: | ||
| 1380 | for recipe in args.recipename: | ||
| 1381 | check_workspace_recipe(workspace, recipe, checksrc=False) | ||
| 1382 | elif not args.all: | ||
| 1383 | raise DevtoolError("Recipe must be specified, or specify -a/--all to " | ||
| 1384 | "reset all recipes") | ||
| 1385 | if args.all: | ||
| 1386 | recipes = list(workspace.keys()) | ||
| 1387 | else: | ||
| 1388 | recipes = args.recipename | ||
| 1389 | |||
| 1390 | _reset(recipes, args.no_clean, config, basepath, workspace) | ||
| 1391 | |||
| 1386 | return 0 | 1392 | return 0 |
| 1387 | 1393 | ||
| 1388 | 1394 | ||
