> I don't think `$prefix/lib' would be the appropriate place to put the
> script files. /lib directory is traditionally intended for the
> architecture-dependent binary libraries loaded by ld.

Yeah, you're right about that. This should be changed.

> All the other resources independent of the architecture
> (and thus can be "shared")
> can just be put in /share/bash/scripts or something.

Sounds good.

Please let me know if you agree to any of the following paths:

    ~/.local/share/bash:/usr/share/bash
    ~/.local/share/bash/lib:/usr/share/bash/lib

The second option clearly denotes the nature of the contents
of the directory and is also more future proof in case more
types of shared bash data is ever added in the future.

Note that the default value of XDG_DATA_HOME
is defined to be ~/.local/share.

I'm not exactly invested in getting any XDG stuff
into bash but it seems like a reasonable enough
default for the user's personal libraries directory.
Not sure if there's a better choice here
but I'm open to other ideas.

> Furthermore, the location overlaps with the loadable builtins, which
> are not the script files intended to be sourced. You are mixing the
> script file with the loadable builtins while trying to separate the
> script files from the executable files. The same issue will arise in
> another place.

I agree. This will be revised.

> This is the same as the argument for the long option. Why only
> BASH_LIBRARIES_PATH (among the other similar variables) should honor
> ~/.local indirectly implied by XDG_DATA_HOME?

There's no particular reason why it should honor any one path or another.
My goal is to add a directory inside the user's home directory to the
BASH_LIBRARIES_PATH by default so that they have a place to put their
functions where they will be found by source when they are used in scripts.
I'm not particularly invested in any particular file system taxonomy.

> In the current state of Bash, any of the XDG user directories
> haven't been hard-coded.

That's true. I don't really mind if it stays that way.

> as you already know, the introduction of any XDG user directories is
> one of the sensitive topics in the bug-bash list, so I believe it
> should be discussed separately.

Yeah I know how contentious that stuff can be.
I'd prefer to avoid the issue altogether so that the patch
won't be blocked on those grounds. I'm open to discussing it
separately though. Not sure if anything will come of it but sure.

> It shouldn't slip into the codebase as a part of another change.

Only reason I used it is it was the first thing that came to mind.
I suppose I've gotten used to treating ~/.local/ as the "user's root".
Not really trying to slip in anything.

  Matheus

Reply via email to