Create versionned directories of the helpers #1717
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
Having a single helpers directory completely freezes its API, we don't want to change it by fear of breaking old or unmaintained apps.
But sometimes we see bugs, deprecated functions, want to change the overall API, want to introduce new behaviours.
Solution
This MR introduces a new variable,
YNH_APP_HELPERS_VERSION
.It's supposed to be synchronous with the
YNH_APP_PACKAGING_FORMAT
, usually. But we might want to have2.x
versions, as a preparation for manifestv3 for example.This variable can be passed as an env var, or as the first arg of the script (
source /usr/share/yunohost/helpers 2.1
). It defaults toYNH_APP_PACKAGING_FORMAT
or to1
.Directories are named
helpers.v${VERSION}.d
.A symlink
helpers.d -> helpers.v1.d
keeps the "legacy" directory.The version
1
is the current one, so old packages won't break.The version
2
is a symlink to v1, so current manifestv2 packages will be fine too.PR Status
Completely untested.
How to test
...