Skip to content

Draft: lib/priority: add a [includes] section and file-optional/file-required keys

adrien requested to merge adrien-n/gnutls:includes-in-configuration into master

This extends the configuration with "include" directives:

[includes]
file-required = /etc/foo
file-optional = /etc/bar

I'm marking this as a draft because I think this requires discussion first. Solves #1300 AFAIU.

I see this is as basically introducing a new API and there are all the same questions:

  • is it needed?
  • is it enough?
  • is it not too much?
  • is the approach good?
  • is the structure appropriate?
  • are the names appropriate?

Needed

I think there is a need, especially for distributions.

Enough

I initially wanted to support directories of files to include but I'm not sure there is actually a use for that. The gnutls configuration is not that big. Moreover, it is unclear that would be immediately needed.

Not too much

File includes is the minimum but are two keys required?

I think included files have to exist: it should be an error otherwise. As for the optional includes, I have to admit I'm using that as a ersatz for directories; this makes it possible for distros to offer a file for user customization.

Approach

I first wanted to mirror the current configuration location at build-time. That was much more involved however. There would also have been two locations for configuration and no rule as to which one would take precedence. Re-using the same location but making it a directory maybe would also have been confusing.

Structure

I'm not entirely happy about how the configuration file becomes structured but it's explicit for users and easy to implement.

Names

Not completely happy about that either. I'm open to changes.

Merge request reports