-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Look for ~/.config/avrdude/config configuration file #1131
Conversation
Traditionally per-user configuration files have been placed in user's home directory with their names beginnig with a dot to hide them from some tools like ls(1). However, the number of programs following this convention have grown over time to the point where the number of hidden files becomes inconvenient to some users. For this reason the XDG Base Directory Specification[1] specifies an alternate place to store configuration files under ~/.config directory. This patch enables avrdude to look for ~/.config/avrdude/config configuration file, if ~/.avrduderc doesn't exist. [1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html
@steelman Thanks for a useful and well-written contribution, espec also for providing documentation. I tested this and reviewed the source and the manual. All good, but I will suggest a few minor changes to the documentation via pushing a small commit onto your branch. One question: how welded are you to the basename The unsuccessful check in this PR is probably a red herring (some timeout in the gitlab runners?). We'll know when the checks are run again. |
I think |
Technically not at all and I understand your question as many programs which moved their files to How about |
The code does not safely concatenate file names for the config file (this problem existed before).
Once, again, many thanks @steelman --- could you please test this? |
How about supporting both in ~/.config ? |
No, the system-wide configuration file contains the full data, whereas .avrduderc is for modifications/new parts/new programmers that the user wishes to put in place. Yes, you are correct, rc originally used to stand for run commands, but it's been used for decades for all sorts of runtime configurations or, as I think of it in the context of AVRDUDE, residual configuration :) Anyway, the name is now defined symbolically in We can (and will) change it once there is a consensus. |
Okay to me as well. |
Really better if it's only one name. Defining an alterative XDG_USER_CONF and then checking in a certain order first in ${XDG_CONFIG_HOME} and then also in ~/.config and explaining all in avrdude.1 and avrdude.texi is just a headache too far... |
Looks good to me. |
I'd even go as far as preferring the new location, and maintaining the old one (until AVRDUDE v8 is released) just as a fallback. I think systems like Windows don't particularly like filenames without a suffix, so I wouldn't pick |
This would make the current code/order change from
|
So, this needs deciding whether to go with @dl8dtl's suggestion of giving preference of new location over traditional (happy with that propsal) and what the name should be. Then final testing and it's good to merge. |
I am okay with @dl8dtl's suggestion. As for the name. if we need to pick only one from |
OK, have changed the order to be xdg-style avrdude.rc file first before fallback ~/.avrduderc and have tested. Also corrected the location and description of avrdude.pdf in avrdude.1. I consider this ready to squash and merge. |
What's your workflow? Am I supposed to it? (Like, I am fine with it, I am asking because this is my first contribution to avrdude) |
Nothing more to do for you, @steelman. Thanks for the idea, initial implementation and contributing to the discussion. We normally let PRs hang around for a couple of days, and then when they are considered ready, there is sometimes another wait until a few ones have batched up that are merged at the same time (it's easier that way). |
…)" This reverts commit 34fa2fa.
Traditionally per-user configuration files have been placed in user's home directory with their names beginnig with a dot to hide them from some tools like ls(1). However, the number of programs following this convention have grown over time to the point where the number of hidden files becomes inconvenient to some users. For this reason the XDG Base Directory Specification[1] specifies an alternate place to store configuration files under ~/.config directory.
This patch enables avrdude to look for ~/.config/avrdude/config configuration file, if ~/.avrduderc doesn't exist.
[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html