This is getting quite complicated
[...] Much simpler is to:
Agreed.
If all we need are system variables ($_Libpath, $_mmapath, etc) then we don't need to read any RC files. Simple.
Well, this is what triggered the question. I change
LibPath and
MMAPath in my
.mmarc.
Just getting a list of MMA's paths and then have the application read the RCs means that the application needs to know how to read a .mma file
Maybe we should take this back to the drawing board.
Originally MMA was developed to be run from a single place, with a single library of modules and grooves etc.
I am probably the first user to maintain a set of private grooves, plugins, and so on in my home folder.
A first complication is that when I run
mma -g it complains about me not having write access to the system files (e.g.
/usr/share/mma). That is okay, but what I usually want is to update the
.mmaDB files in my home folder. So it would be nice if MMA would skip the system folders. So instead of enumerating all files that were skipped:
Processing library directory '/usr/share/mma/lib'.
Skipping '/usr/share/mma/lib', no write access.
Processing library directory '/usr/share/mma/lib/kara'.
Skipped: /usr/share/mma/lib/kara/2beatp.mma
Skipped: /usr/share/mma/lib/kara/8beatmotown.mma
...
Skipping '/usr/share/mma/lib/kara', no write access.
Processing library directory '/usr/share/mma/lib/pflib'.
Skipped: /usr/share/mma/lib/pflib/16beat1.mma
Skipped: /usr/share/mma/lib/pflib/16beat2.mma
...
Error: <Line 36> You probably need to be 'root' to properly update your libraries.
just a simple
Processing library directory '/usr/share/mma/lib'.
Skipping '/usr/share/mma/lib', no write access.
To get back to the mma-gb issue: Maybe introduce two environment variables MMA_LIBRARY (or MMA_LIBPATH) and MMA_PLUGINS (MMA_PLUGPATH) that take a list of directories to be prepended to $_LibPath and $_PlugPath? It would be rather straightforward for mma and mma-gb to deal with.
Maybe MMA_LIB as well? MMA processes a fixed list of directories and considers the first directory with a subdirectory
MMA to be the MMA library. It really should use a list of paths instead of a fixed dir.