feature-flags.rst 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Feature flags
  2. =============
  3. Feature flags provide a convenient way to define package selections without
  4. making it necessary to list each package explicitly.
  5. The main feature flag definition file is ``package/features``, but each package
  6. feed can provide additional defintions in a file called ``features`` at the root
  7. of the feed repository.
  8. Each flag *$flag* without any explicit definition will simply include the package
  9. with the name *gluon-$flag* by default. The feature definition file can modify
  10. the package selection in two ways:
  11. * The *nodefault* function suppresses default of including the *gluon-$flag*
  12. package
  13. * The *packages* function adds a list of packages (or removes, when package
  14. names are prepended with minus signs) when a given logical expression
  15. is satisfied
  16. Example::
  17. nodefault 'web-wizard'
  18. packages 'web-wizard' \
  19. 'gluon-config-mode-hostname' \
  20. 'gluon-config-mode-geo-location' \
  21. 'gluon-config-mode-contact-info'
  22. packages 'web-wizard & (mesh-vpn-fastd | mesh-vpn-tunneldigger)' \
  23. 'gluon-config-mode-mesh-vpn'
  24. This will
  25. * Disable the inclusion of a (non-existent) package called *gluon-web-wizard*
  26. * Enable three config mode packages when the *web-wizard* feature is enabled
  27. * Enable *gluon-config-mode-mesh-vpn* when both *web-wizard* and one
  28. of *mesh-vpn-fastd* and *mesh-vpn-tunneldigger* are enabled
  29. Supported syntax elements of logical expressions are:
  30. * \& (and)
  31. * \| (or)
  32. * \! (not)
  33. * parentheses