summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2019-07-18 21:44:03 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-19 17:53:16 +0000
commit87ed33882397782511fce4529e3ca661e939f164 (patch)
tree0c441a633e56013b63bef3b0efcd261928132250
parent4de721d62bec7ab07f55e425c2d2388e0923cd56 (diff)
downloadbuildstream-87ed33882397782511fce4529e3ca661e939f164.tar.gz
Don't remove workspace directory when `--no-checkout` option is given
When `--no-checkout` flag is used, BuildStream assumes that the target destination already contain the sources (potentially edited already). Hence BuildStream must not remove its contents. Fixes #1086. --- Also, fix a minor typo in the file that probably doesn't need a commit of its own.
-rw-r--r--src/buildstream/_stream.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 11ac53f3f..d791449cc 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -771,14 +771,14 @@ class Stream():
.format(target.name, directory), reason='bad-directory')
# So far this function has tried to catch as many issues as possible with out making any changes
- # Now it dose the bits that can not be made atomic.
+ # Now it does the bits that can not be made atomic.
targetGenerator = zip(elements, expanded_directories)
for target, directory in targetGenerator:
self._message(MessageType.INFO, "Creating workspace for element {}"
.format(target.name))
workspace = workspaces.get_workspace(target._get_full_name())
- if workspace:
+ if workspace and not no_checkout:
workspaces.delete_workspace(target._get_full_name())
workspaces.save_config()
shutil.rmtree(directory)