spl:remove-feature
Remove a feature from an SPL, together with the constraints that name it.
Usage
splent spl:remove-feature <spl_name> <feature> [--force]
Requires detached mode (no product selected).
<feature> is the short name (notes) or the package
(splent_feature_notes).
Options
| Option | Description |
|---|---|
--force |
Remove the feature even when other features depend on it, dropping their constraints too. |
How it works
The counterpart of spl:add-feature. Editing the
.uvl by hand is how a model and its constraints drift apart: the
declaration is easy to find, the constraints naming it are further down.
- Resolves the model like every
spl:*command: working copy, then cache, then UVLHub. - Looks the feature up by short name or package. When it is not declared, the command lists the features that are and exits non zero.
- Refuses while another feature still depends on it (
a => <feature>), because the model would no longer describe a satisfiable configuration.--forceremoves it anyway and drops those constraints. - Removes the declaration and every
a => bconstraint that names the feature on either side. Aconstraintssection left empty is removed, and so is anyoptional,mandatory,alternativeororgroup left with nothing under it, since UVL rejects both. - Writes to the working copy, never to the cache. A model that so far
only exists in the cache is first copied to
splent_spl_<name>/, asspl:add-featuredoes. - Keeps the previous model as
<file>.uvl.bak, writes atomically and re-reads the result. If the feature is still there or the file no longer parses, the original is restored and the command exits non zero.
Example
$ splent spl:remove-feature sample_splent_spl mailhog
Removed 'mailhog' from sample_splent_spl.
dropped constraint: mailhog => mail
Refused while something depends on the feature:
$ splent spl:remove-feature sample_splent_spl mail
mail cannot be removed: confirmemail, mailhog, reset depend on it.
Remove those first, or pass --force to drop their constraints along with it.
See also
- spl:add-feature. Add a feature with auto-detected constraints
- spl:features. List all features in the SPL
- spl:deps. Show feature dependencies