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.

  1. Resolves the model like every spl:* command: working copy, then cache, then UVLHub.
  2. 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.
  3. Refuses while another feature still depends on it (a => <feature>), because the model would no longer describe a satisfiable configuration. --force removes it anyway and drops those constraints.
  4. Removes the declaration and every a => b constraint that names the feature on either side. A constraints section left empty is removed, and so is any optional, mandatory, alternative or or group left with nothing under it, since UVL rejects both.
  5. 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>/, as spl:add-feature does.
  6. 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


Back to top

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