Closed LeroyR closed 3 years ago
I have prepared the following change:
The
!b!include FILENAME
and!b!literal-include FILENAME
constructs can now refer to the to-be-included file in three ways
FILENAME-NOT-STARTING-WITH-/
is interpreted as a filename relative to the directory of the recipe file in which the include construct occurs.
/REST-OF-FILENAME-NOT-STARTING-WITH-/
is interpreted as an absolute filename.
//REST-OF-FILENAME
is interpreted as a filename relative to the root directory of the repository containing the recipe file in which the include construct occurs, that isREPOSITORY-ROOT/REST-OF-FILENAME
.So assuming a repository
/home/recipes
containing a recipe/home/recipes/projects/my-project.project
, include filename would be resolved as follows!b!include patches/patch.diff → /home/recipes/projects/patches/patch.diff !b!include /usr/share/patches/patch.diff → /usr/share/patches/patch.diff !b!include //patches/patch.diff → /home/recipes/patches/patch.diff
Would that work for you?
Looks good. Do we keep the distribution include parameter resolving files relative to the distributions dir.
Do we keep the distribution include parameter resolving files relative to the distributions dir.
If you mean the literal-include
in
RECIPES/distribution/foobar.distribution
- name: Foo
parameters:
patches.diff-strings:
- !b!literal-include ../projects/patches/foo.patch
the include should be resolved relative to the recipe file containing the literal-include
, if the filename is given using a relative syntax. This behavior is not affected by the proposed change.
I mean
RECIPES/distribution/stacks/bonsai/ros.distribution
include:
- stacks/rosjava
To
- //stacks/rosjava
The scope of this change is limited to !b!include
and !b!literal-include
. Please file a separate issue if you want a similar change for include:
in distribution recipes.
Is your feature request related to a problem? Please describe. Including a file in a distribution/project has to currently use a relative path e.g.
This is error prone and un-intuitive for stacks. As stack inclusion is relative from the distribution folder of the recipes e.g.
Describe the solution you'd like Possibility to define literal-includes relative to the RECIPES dir. And more obvious distinction for paths relative to current file.
Example:
This would be a breaking change for stacks only i think.