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.

  1. Resolves the model like every spl:* command, from the working copy, the cache or UVLHub.
  2. Finds the feature by short name or package. When it is not declared, it lists the features that are and exits non-zero.
  3. Refuses while another constraint needs it, any constraint naming it other than its own requirements, such as a => <feature> or a => b & <feature>. --force removes 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.
  4. Removes the declaration and every constraint that names the feature, simple or compound. A constraints header left with only blank lines and comments goes too, and so does any optional, mandatory, alternative or or group left empty, since UVL rejects both.
  5. Writes the working copy, never the cache. A model only in the cache is first copied to splent_spl_<name>/, as spl:add-feature does.
  6. 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_spl that declares notes => auth & profile, removing profile is 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. In my_spl, where editions is declared under events, removing events gives this.
    $ splent spl:remove-feature my_spl events
      events cannot be removed: it has child features (editions).
      Remove those first.
    

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es