-
Notifications
You must be signed in to change notification settings - Fork 123
elektrify lcdproc #1266
Comments
The most important goal is: total number of code in lcdproc should be reduced drastically. Note: If we generate some docu out of specs, |
I'm not sure what "reduced drastically" means. Any patch that removes more code than it adds will make me quite happy. What I tried to say yesterday: lcdproc has a very crude configuration system, yet everybody (except the package maintainers) seems to be happy with that. So adding fancy new features around configuration specification probably won't be much of a selling point. Reducing complexity and lines of code to maintain will be very welcome, so I recommend that this should be a focus. In the todo list above, I don't understand what "tool to set multiple key/values from a template" means. |
It refers to the 1883 lines from
Exactly!
There is not much that could be done wrong with a typed Btw. why is the (uncommented) section for every driver in the config file so important if you have hard-coded default values anyway?
It would be about setting up a driver with one |
I'd do as much cleanup as possible. Any API that only exists for historic reasons is a perfect candidate to get rid of. Should we need any internal API to interface to elektra, it would be worth considering if elektra isn't missing some convenience API. - I know, updateing all the many drivers to the new configration API will be a lot of boring work. I guess this is a good excuse to finally drop all the deprecated drivers instead of putting work into them. Also IMO there is nothing wrong with mildly pestering the authors of the recently added drivers, to help with the transition.
I don't know what the initial intention has been. I see it primarily as a convenient form of documentation. As long as we can still ship configuration with reasonable defaults, I think the template tool is low priority. |
An API, like lcdproc currently has, is definitely missing and it is one of our must-haves for 1.0, see #1270. It just means that lcdproc would depend on Elektra 0.8.20 or later. But obviously it reduces even more code. The alternative would be code-generation: for generated code it does not matter if it directly uses low-level APIs. Any 0.8 Elektra would be okay then.
Maybe we write a tool for automatic migration, shouldn't be too hard and would be useful for most of the other projects, too.
That would be for the lcdproc's community to decide. But you definitely can use the migration as excuse ;)
If it is documentation for defaults you would put it as comments in the file, wouldn't you? But it is actually not really important, a 3-way merger should be able to add a new section for a new driver easily -- even if the file is heavily edited.
Ok, I moved it down in the list. |
LCDd.conf is also used by Config::Model to enable lcdproc with cme. Which also enable automatic configuration upgrade on Debian systems. |
As a casual contributor to lcdproc, I'm a bit sceptical of this project. Its feature list looks nice and all, but it seems a bit to me like xkcd: Standards. Is libelektra actually used by any third-party project? |
Hi antoneliasson,
We use this xkcd in presentations ourselves. Elektra does not invent a new configuration file format but abstracts over them.
Yes, many projects use it. Unfortunately(*), however, mostly within universities and companies. there are already FLOSS applications using it (oyranos, which is not packaged in Debian/Ubuntu thus you cannot find it with (*) Unfortunately because our main goal is to improve FLOSS, not proprietary software.
Yes, it is early adoption but I think we can both profit from it. For lcdproc it will be a simplification of code while getting many more tools to work with configuration, for Elektra it will improve its adoption and packaging. For oyranos it works well on both sides, see our discussions here in the issue tracker, e.g. #1134. |
@antoneliasson I see your point. However, it is not like we are inventing a new thing here, but rather that we get rid of our own custum (and largely unmaintained) code. If you have any alternative to elektra in mind, that would be interesting to hear. The pros for elektra from my POV are:
|
On Saturday, 21 January 2017 05:04:38 CET haraldg wrote:
f you have any alternative to elektra in mind, that would be interesting to
hear.
Well, one alternative is to use an external ini parser library.
Main drawbacks:
* find a volunteer to do the work
* find a library that support lcdproc's usage of ini format (I've seen more
several incompatible ways to use INI files..)
Or try to avoid INI file format limitation and ambiguities and switch to a
saner format like YAML. In this case, finding a parser lib is easy.
Using a dummy example that I quickly cobbled together, such a file would look
like
```
$ cme dump lcdproc
---
CFontzPacket:
Contrast: 563
EyeboxOne:
Device: /dev/ttyS2
server:
Driver:
- CFontzPacket
- EyeboxOne
Hello:
- Salut les copains
```
Drawbacks:
* same volunteer issue
* user has to translate his config file to YAML (which could be done
automatically on Debian, manually with `cme migrate lcdproc` elsewhere)
* a doc would need to be written to replace the comments of LCDd.conf
The pros for elektra from my POV are:
It supports ini as format, so I expect we can keep the configuration files
almost unchanged. Somebody else seems willing to do the work.
It is active, well maintained and carefully designed.
I'm the maintainer of the OpenWRT package, so I'm already somewhat familiar
with it.
All this make elektra quite a good option.
HTH
…--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
|
I think what my concerns boil down to is this: If Elektra does not take off and achieve world dominance, will we be worse off than before? Do we retain the old way of configuring things, i.e. manually editing a ini file in /etc and then reloading/restarting the system service? Or do things have to be done the Elektra way from now on, by "mounting" configuration files and editing them with kdb or similar tool? Although if Elektra does take off, I'll be more open to getting rid of old stuff, like lcdproc's not very well structured ini file, and replacing it with a better format. |
Thanks for the interesting questions!
Basically this is what we did the last years: Not only offer an API and wait for world dominance but to offer an implementation that can compete with any configuration library out there. We are not completely there yet (there are some details where specific other libraries are better than Elektra in specific points) but these are not points that the current configuration system of lcdproc supports (not even close). And the libraries that can compete with Elektra have a completely different level on which dependencies they have: Elektra is the only one only requiring libc.
Absolutely, you can think of libelektra as a small library in C that reads the ini file like it was done before. So you would have the same INI file as before.
Elektra does not interfere with restarting. It provides some techniques for reloading but they are optional. So you can tell us your requirements of reloading are, or we also can implement it in the same way as it is done currently. (Without further feedback we most likely would simply replace
Mounting is a new possibility for you to, e.g., use a different configuration file format, directly write into git instead of files, download files from a server instead using a local ones and much more. But for users that want to keep the default (which seems like it will be the same INI file as it is now?), they do not have to bother about Elektra at all.
The
In Elektra all users can select their own favourite format. We already have, e.g. JSON and INI, and we are currently working on full-blown XML (see #1280) and YAML. The default format obviously is something lcdproc can decide (also (re)decide at any later point of time). EDIT: sudoedit -> visudo |
Great! No more objections from me then, your honor! |
In lcdproc we have a discussion, that among other things touches how we might want to store additional information in the config file in the future. If you think this is relevant for your work, please chime in: |
I made following two points from above obsolete:
rationale: 1. @Piankero already wrote the specification, 2. is out of scope |
http://lcdproc.org/ repo at https://github.com/lcdproc/lcdproc
egrep -rH 'config_get_(bool|int|tristate|float|string)'
kdb fstab
command is confusing #1188)obsolete
The text was updated successfully, but these errors were encountered: