On Thu, 8 Dec 2011, Berend Hasselman wrote:
On Mac OS X function files/packages and databases will be
installed on demand in subdirectories of a "personal"
directory "~/Library/Application Support/gretl" [...]
On Linux (as tested by me on Ubuntu 10.04 and Xubuntu
11.04/11.10 all of which running in VirtualBox virtual
machines) the situation is quite different.
Function files/packages are stored in a user's work dir.
However if one sets the working directory to follow the
shell current directory one may end up with multiple
installations of the same functions. With functions
scattered over several different directories. I find this
rather confusing.
Databases appear to be only installed in
/usr/local/share/gretl/db. When I tried to install a
database from the database server I got an error message
"Permission denied". Why not in "work dir/db"?
I would like to suggest to install function files/packages
and databases on Linux for users in a fixed directory so
that the location is independent of the gretl working
directory. Similar to Mac OS X and Windows.
Something like ~/.config/gretl or even ~/library/gretl or
whatever else is sensible for Linux.
I've now taken a look at this. Here's what's supposed to
happen on Linux:
1) We first try installing downloaded gretl stuff (whether
databases, function packages or collections of datafiles) into
the relevant "system" location, ${prefix}/share/gretl/<subdir>
where <subdir> is "db", "functions" or "data".
2) If that fails due to lack of wite permission, we write
instead to a "suitable location" under the user's home
directory.
Now, in testing this I found that progression from 1) to 2)
was (at least partially) broken -- fallout from a
reorganization of gretl's error-recording and -reporting
mechanism, I'm afraid. That accounts for the "permission
denied" message you saw on downloading a database. That's
fixed in CVS.
The other issue is, What's the most suitable non-system
location for such files? I take your point, that if the user
has chosen to have the working directory follow the shell
(which I favour myself) -- and does not have write permission
for the system share/gretl tree -- downloaded files may end up
scattered here and there, which is undesirable.
So in CVS I've modified things such that the user's "dotdir"
(i.e. ~/.gretl on Linux) is used instead, with the standard
subdirectories "db", "functions" and "data". (For backward
compatibility, we still search the working directory when
assembling lists of databases, etc.)
You mention possibilities such as ~/library/gretl, but I don't
think that's really good citizenship. The usual presumption on
*nix is that a program is entitled to have a "dot-file" and/or
"dot-directory" under its own name in $HOME, but users might
reasonably be aggrieved if the program created other trees. (I
might already have a ~/library directory that has nothing to
do with gretl.)
Allin