NetworkManager/include
Thomas Haller 7182304684 config: allow to enable/disable configuration snippets
Support a new configuration option

  [.config]
  enable=<ENABLED>

for configuration snippets.

This new [.config] section is only relevant within the snippet itself
and it is not merged into the combined configuration.

Currently only the "enable" key is supported. If the "enable" key is
missing, it obviously defaults to being enabled. It allows snippets
to be skipped from loading. The main configuration "NetworkManager.conf"
cannot be skipped.

<ENABLED> can be a boolean value (false), to skip a configuration
snippet from loading.
It can also be a string to match against the NetworkManager version,
like "enable=nm-version-min:1.1,nm-version-min:1.0.6"

There are several motivations for this:

- the user can disable an entire configuration snippet by toggeling
  one entry.
  This generalizes  the functionality of the global-dns.enable
  setting, but in a way that applies to configuration on a per-file
  basis.

- for developing, we often switch between different versions of
  NetworkManager. Thus, we might want to use different configuration.
  E.g. before global-dns options, I want to use "dns=none" and manage
  resolv.conf myself. Now, I can use global-dns setting to do that.
  That can be achieved with something like the following (not exactly,
  it's an example only):

      [.config]
      enable=nm-version-min:1.1
      [main]
      dns=default
      [global-dns-domain-*]
      nameserver=127.0.0.1

  Arguably, this would be more awesome, if we would bump our micro devel
  version (1.1.0) more often while developing 1.2.0 (*hint*).

- in principle, packages could drop configuration snippets and enable
  them based on the NetworkManager version.

- with the "env:" spec, you can enable/disable snippets by configuring
  an environment variable. Again, useful for testing and developing.
2015-10-05 17:12:50 +02:00
..
gsystem-local-alloc.h libgsystem: update copy of gsystem-local-alloc.h 2015-03-12 18:09:29 +01:00
Makefile.am build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h" 2015-09-30 23:10:29 +02:00
nm-dbus-compat.h include: add nm-dbus-compat.h 2015-07-24 13:25:47 -04:00
nm-default.h systemd/build: use separate NETWORKMANAGER_COMPILATION define for systemd build 2015-09-16 16:54:51 +02:00
nm-glib.h glib-compat: add g_hash_table_get_keys_as_array() compat function 2015-10-01 09:05:08 +02:00
nm-macros-internal.h config: allow to enable/disable configuration snippets 2015-10-05 17:12:50 +02:00
nm-test-utils.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-version-macros.h.in build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h" 2015-09-30 23:10:29 +02:00