spl:remove-feature
Removes a feature from an SPL model together with every constraint that names it, the counterpart of spl:add-feature. By hand it is easy to delete the declaration and miss the constraints further down. It runs in detached mode (no product selected).
Example
$ splent spl:remove-feature sample_splent_spl mailhog
Removed 'mailhog' from sample_splent_spl.
dropped constraint: mailhog => mail
Options
| Argument / Option | Description |
|---|---|
<spl_name> |
The SPL to change. |
<feature> |
The short name (notes) or the package (splent_feature_notes). |
--force |
Remove the feature even when other constraints need it, dropping those constraints too. It never removes a feature with child features. |
What it does
Nothing is asked. Once the checks pass, the feature is removed.
- Resolves the model like every
spl:*command, from the working copy, the cache or UVLHub. - Finds the feature by short name or package. When it is not declared, it lists the features that are and exits non-zero.
- Refuses while another constraint needs it, any constraint naming it other than its own requirements, such as
a => <feature>ora => b & <feature>.--forceremoves it anyway and drops those constraints. A feature with child features is always refused until its children are gone, since removing only its line would hang them from the sibling above. - Removes the declaration and every constraint that names the feature, simple or compound. A
constraintsheader left with only blank lines and comments goes too, and so does anyoptional,mandatory,alternativeororgroup left empty, since UVL rejects both. - Writes the working copy, never the cache. A model only in the cache is first copied to
splent_spl_<name>/, asspl:add-featuredoes. - Checks the result. It keeps the previous model as
<file>.uvl.bak, writes atomically and re-reads the file, parsing it with flamapy when installed. If the feature is still there or the file does not parse, the original is restored and it exits non-zero.
Special cases
- 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. - A compound constraint names it. In a model
my_splthat declaresnotes => auth & profile, removingprofileis refused the same way. When simple dependents exist too, they come first and the second line reads `is also named in these constraints.` (or `this constraint` for one). $ splent spl:remove-feature my_spl profile profile cannot be removed: it is named in this constraint. notes => auth & profile Remove those first, or pass --force to drop their constraints along with it. - It has child features. Refused even with
--force. Inmy_spl, whereeditionsis declared underevents, removingeventsgives this.$ splent spl:remove-feature my_spl events events cannot be removed: it has child features (editions). Remove those first.
See also
spl:featureslists the features in the SPL.spl:depsshows feature dependencies.