summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-12-22 17:03:14 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-22 16:44:04 +0000
commit1c616802ba2cfb37f8403f1dc6cf91ce3bd99ac2 (patch)
tree66b55233f21ac0f3df7b4d83398fe4d703d8c9e9 /scripts
parent29833828a90c8433af3b231b50e99cd97edf19ff (diff)
downloadopenembedded-core-1c616802ba2cfb37f8403f1dc6cf91ce3bd99ac2.tar.gz
openembedded-core-1c616802ba2cfb37f8403f1dc6cf91ce3bd99ac2.tar.bz2
openembedded-core-1c616802ba2cfb37f8403f1dc6cf91ce3bd99ac2.zip
devtool: reset: print message about leaving source tree behind
We deliberately leave the source tree alone when resetting in case it contains any work in progress belonging to the user; tell them that we're doing this so they aren't surprised about it still existing later on. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index ed9e793d4a..a9c4cf8d8d 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1229,6 +1229,17 @@ def reset(args, config, basepath, workspace):
# We don't automatically create this dir next to appends, but the user can
preservedir(os.path.join(config.workspace_path, 'appends', pn))
+ srctree = workspace[pn]['srctree']
+ if os.path.isdir(srctree):
+ if os.listdir(srctree):
+ # We don't want to risk wiping out any work in progress
+ logger.info('Leaving source tree %s as-is; if you no '
+ 'longer need it then please delete it manually'
+ % srctree)
+ else:
+ # This is unlikely, but if it's empty we can just remove it
+ os.rmdir(srctree)
+
return 0