diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2019-04-10 14:43:50 +0100 |
---|---|---|
committer | Chandan Singh <csingh43@bloomberg.net> | 2019-04-10 14:43:50 +0100 |
commit | 3c0f540dd620de30445ac2351821c9a395aa750f (patch) | |
tree | 76e3bbfad91e563d517ef2387982be7e0d9972dc | |
parent | a2da1f180802518bcd0b2d054098e4986ae2d771 (diff) | |
download | buildstream-chandan/fix-default-target-junctions.tar.gz |
_project.py: Do not find default targets in .bst directorychandan/fix-default-target-junctions
In cases where element path is set to `.` and the project has some
junctions, we have to be careful when trying to find the default
targets. We can't simply find all files ending with `.bst`. But, we
first need to ensure that we do not recurse down the `.bst` directory
which is used to store BuildStream internals.
Fixes #992.
-rw-r--r-- | buildstream/_project.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py index af0c8d7b3..93ed9fc3e 100644 --- a/buildstream/_project.py +++ b/buildstream/_project.py @@ -543,7 +543,11 @@ class Project(): # If default targets are not configured, default to all project elements default_targets = [] - for root, _, files in os.walk(self.element_path): + for root, dirs, files in os.walk(self.element_path): + # Do not recurse down the ".bst" directory which is where we stage + # junctions and other BuildStream internals. + if ".bst" in dirs: + dirs.remove(".bst") for file in files: if file.endswith(".bst"): rel_dir = os.path.relpath(root, self.element_path) |