summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-11-20 17:32:58 +0000
committerJürg Billeter <j@bitron.ch>2018-11-20 17:32:58 +0000
commitfb8860db51e5a6349f961bad25ed1d98375b749b (patch)
tree5624def39da0252d2d804ad2912dc38cbe3866d3
parentc6306b88b9544a1cbbe4ed265b4ac018a9bd8803 (diff)
parent9fa8a881ffcd36adf61c6a02f0251cd5447df76d (diff)
downloadbuildstream-fb8860db51e5a6349f961bad25ed1d98375b749b.tar.gz
Merge branch 'jennis/less_restrictive_pathways' into 'master'
Fix warning when using an absolute path which exists inside the project See merge request BuildStream/buildstream!956
-rw-r--r--buildstream/_yaml.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py
index c8f11bc96..4fe844a80 100644
--- a/buildstream/_yaml.py
+++ b/buildstream/_yaml.py
@@ -476,12 +476,18 @@ def node_get_project_path(node, key, project_dir, *,
is_inside = project_dir_path.resolve() in full_resolved_path.parents or (
full_resolved_path == project_dir_path)
- if path.is_absolute() or not is_inside:
+ if not is_inside:
raise LoadError(LoadErrorReason.PROJ_PATH_INVALID,
"{}: Specified path '{}' must not lead outside of the "
"project directory"
.format(provenance, path_str))
+ if path.is_absolute():
+ raise LoadError(LoadErrorReason.PROJ_PATH_INVALID,
+ "{}: Absolute path: '{}' invalid.\n"
+ "Please specify a path relative to the project's root."
+ .format(provenance, path))
+
if full_resolved_path.is_socket() or (
full_resolved_path.is_fifo() or
full_resolved_path.is_block_device()):