summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py4
-rw-r--r--scripts/lib/devtool/standard.py14
2 files changed, 11 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 904ff6988b5..a5e17d18d61 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -384,6 +384,8 @@ class DevtoolAddTests(DevtoolBase):
result = runCmd('devtool status')
self.assertNotIn('libftdi', result.output)
self.assertTrue(stampprefix, 'Unable to get STAMP value for recipe libftdi')
+ # Trigger sstate sysroot cleanup
+ bitbake('-p')
matches = glob.glob(stampprefix + '*')
self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned')
self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning')
@@ -1198,6 +1200,8 @@ class DevtoolExtractTests(DevtoolBase):
result = runCmd('devtool status')
self.assertNotIn(testrecipe1, result.output)
self.assertNotIn(testrecipe2, result.output)
+ # Trigger sstate sysroot cleanup
+ bitbake('-p')
matches1 = glob.glob(stampprefix1 + '*')
self.assertFalse(matches1, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe1)
matches2 = glob.glob(stampprefix2 + '*')
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 47ed531b037..68a9050c845 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1753,7 +1753,7 @@ def status(args, config, basepath, workspace):
return 0
-def _reset(recipes, no_clean, config, basepath, workspace):
+def _reset(recipes, clean, config, basepath, workspace):
"""Reset one or more recipes"""
import oe.path
@@ -1777,7 +1777,7 @@ def _reset(recipes, no_clean, config, basepath, workspace):
else:
os.remove(new_layerconf_file)
- if recipes and not no_clean:
+ if recipes and clean:
if len(recipes) == 1:
logger.info('Cleaning sysroot for recipe %s...' % recipes[0])
else:
@@ -1858,7 +1858,7 @@ def reset(args, config, basepath, workspace):
else:
recipes = args.recipename
- _reset(recipes, args.no_clean, config, basepath, workspace)
+ _reset(recipes, args.clean, config, basepath, workspace)
return 0
@@ -1909,7 +1909,6 @@ def finish(args, config, basepath, workspace):
else:
raise DevtoolError('Source tree is not clean:\n\n%s\nEnsure you have committed your changes or use -f/--force if you are sure there\'s nothing that needs to be committed' % dirty)
- no_clean = False
tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
try:
rd = parse_recipe(config, tinfoil, args.recipename, True)
@@ -1990,7 +1989,6 @@ def finish(args, config, basepath, workspace):
if origlayerdir == config.workspace_path and destpath:
# Recipe file itself is in the workspace - need to move it and any
# associated files to the specified layer
- no_clean = True
logger.info('Moving recipe file to %s%s' % (destpath, dry_run_suffix))
for root, _, files in os.walk(recipedir):
for fn in files:
@@ -2061,7 +2059,7 @@ def finish(args, config, basepath, workspace):
if args.dry_run:
logger.info('Resetting recipe (dry-run)')
else:
- _reset([args.recipename], no_clean=no_clean, config=config, basepath=basepath, workspace=workspace)
+ _reset([args.recipename], clean=False, config=config, basepath=basepath, workspace=workspace)
return 0
@@ -2172,7 +2170,9 @@ def register_commands(subparsers, context):
group='working', order=-100)
parser_reset.add_argument('recipename', nargs='*', help='Recipe to reset')
parser_reset.add_argument('--all', '-a', action="store_true", help='Reset all recipes (clear workspace)')
- parser_reset.add_argument('--no-clean', '-n', action="store_true", help='Don\'t clean the sysroot to remove recipe output')
+ group = parser_reset.add_mutually_exclusive_group()
+ group.add_argument('--no-clean', '-n', action="store_false", dest='clean', default=False, help='Don\'t clean the sysroot to remove recipe output (default, no-op)')
+ group.add_argument('--clean', '-c', action="store_true", dest='clean', default=False, help='Clean the sysroot to remove recipe output immediately, instead of it being cleaned up automatically upon the next build operation.')
parser_reset.set_defaults(func=reset)
parser_finish = subparsers.add_parser('finish', help='Finish working on a recipe in your workspace',