James Ennis pushed to branch jennis/less_restrictive_pathways at BuildStream / buildstream
Commits:
-
29fd3830
by James Ennis at 2018-11-16T10:10:31Z
1 changed file:
Changes:
... | ... | @@ -475,12 +475,18 @@ def node_get_project_path(node, key, project_dir, *, |
475 | 475 |
is_inside = project_dir_path.resolve() in full_resolved_path.parents or (
|
476 | 476 |
full_resolved_path == project_dir_path)
|
477 | 477 |
|
478 |
- if path.is_absolute() or not is_inside:
|
|
478 |
+ if not is_inside:
|
|
479 | 479 |
raise LoadError(LoadErrorReason.PROJ_PATH_INVALID,
|
480 | 480 |
"{}: Specified path '{}' must not lead outside of the "
|
481 | 481 |
"project directory"
|
482 | 482 |
.format(provenance, path_str))
|
483 | 483 |
|
484 |
+ if path.is_absolute() and is_inside:
|
|
485 |
+ raise LoadError(LoadErrorReason.PROJ_PATH_INVALID,
|
|
486 |
+ "Absolute pathway: '{}' invalid.\n"
|
|
487 |
+ "Please specify a pathway relative to the project's root."
|
|
488 |
+ .format(path))
|
|
489 |
+ |
|
484 | 490 |
if full_resolved_path.is_socket() or (
|
485 | 491 |
full_resolved_path.is_fifo() or
|
486 | 492 |
full_resolved_path.is_block_device()):
|