eckit
eckit copied to clipboard
Add support for colon seperated list of library homes
Allows setting multiple homes in a colon seperated string. e.g. ECKIT_HOME=/path/to/home1:/path/to/home2
This is useful for libraries which like to search for multiple configs, which may be in distinct directories. LocalPathName's tilde expansion ~eckit/file
will match the first existing file from [/path/to/home1/file1, /path/to/home2/file]
. If none exist, the first is used.
No change in behaviour is intended if a single home is set.
If LIB_HOME is not set, there is a change in behaviour in the tilde expansion:
- Before: eckit would search recursively upwards from the prefix directory all the way to the root directory.
- e.g.
~eckit/file1
->libraryprefix/file1
,libraryprefix/../file1
,libraryprefix/../../file1
,libraryprefix/../../../file1
.../file1
- e.g.
- Now: eckit will search the prefix directories and one and two levels above it, then go straight to the root. (exactly four directories)
- e.g.
~eckit/file1
->libraryprefix/file1
,libraryprefix/../file1
,libraryprefix/../../file1
,libraryprefix/../../file1
,/file1
- e.g.
note This does mean that LIB_HOME cannot be set to directories whose path contains a colon.