Hello, @Werner: any thoughts/comments on this? Am Dienstag, 4. Dezember 2012 schrieb Vincent Untz:
Le mardi 04 décembre 2012, à 12:59 +0100, Sascha Peilicke a écrit :
On 12/03/2012 07:34 PM, Andrey Borzenkov wrote:
Well, this file has no reason to be executable and it is in any case not a config file which is supposed to be edited by user.
"Not supposed to be edited by user" also means it shouldn't live in /etc ;-) Nevertheless, /etc/bash_completion.d/ is currently the best (or should I say least-bad?) choice you have.
I see that at least one package installs completion under /usr/share/bash-completion/completions/; is it new place or package error?
At least this deviates from the majority of packages, does someone know if bash looks at this directory too? If so, the best approach would be to not do 1) but fix all other packages instead.
/usr/share/bash-completion/ comes from the bash-completion package. I would think it's not expected to install files there, as this will likely only work when bash-completion is installed.
Exactly, /usr/share/bash-completion/ is not really an option. I'm afraid the problem is slightly[tm] bigger than you might think - we have /etc/profile.d/ (read when a _login shell_ is started) which works for setting environment variables, but fails for things like completion that must be read whenever a new (non-login) shell is started. See http://lists.opensuse.org/opensuse-factory/2012-07/msg00233.html and http://lists.opensuse.org/opensuse-factory/2012-07/msg00234.html for details (BTW: /etc/bash.bashrc already contains workarounds for /etc/bash_completion.d/ and various files in /etc/profile.d - which doesn't match the idea of a "just drop a file" directory). The correct solution would be to have a) /etc/profile.d/ - setting up environment variables, read for login shells (environment variables are exported to child processes - no need to read /etc/profile.d/* again) b) /etc/bash.d/ [1] - files that are read whenever a bash is started, basically a modular bashrc for setting up aliases, functions etc. Maybe the files from /etc/bash_completion.d could also be moved here [2]. c) /usr/share/profile.d/ and /usr/share/bash.d/ [3] as counterparts to the directories in /etc. The /usr/ directories should be used for packaged files which typically won't be edited by a user. Ideally we would have a check for files with the same name in /etc/, which would skip reading the /usr files (similar to the way systemd uses) [4] Afterwards, we could - "cleanup" /etc/profile.d/ - some of the files should live in /etc/bash.d - drop various ". $foo" workarounds from /etc/bash.bashrc What do you thing about this proposal? Regards, Christian Boltz [1] same for other shells on the long term [2] technically, you can do it the other way round and put stuff you want to read at each bash startup in /etc/bash_completion.d/ - but the directory name implies it's only meant for completion. [3] Directory names are only proposals, feel free to propose better ones [4] untested: for file in /usr/share/bash.d/* ; do test -f /etc/bash.d/$(basename $file) && continue . $file done --
Man könnte statt bisher zwei nun vier Files anlegen. [...] Kurz gesagt: Das ist zu kompliziert. Ich habe gehofft, dass du das sagst. [Ratti und > Christian Boltz in fontlinge-devel]
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org