[GRASS-user] locating GRASS installation directories on different operating systems

Tyler Smith tyler at plantarum.ca
Thu Oct 29 07:28:56 PDT 2015


Hi,

I'm updating my Emacs grass-mode (available on MELPA, and also here:
https://bitbucket.org/tws/grass-mode.el/wiki/Home ).

Part of the configuration requires that users tell me where their grass
binary, script and documentation files are. Since people may be using
different versions, multiple versions, pre-packaged or compiled from
source, I can't hard-code paths for this. 

I work on Linux, and I think a reasonably robust way for users to find
the information is:

    which grass (i.e., /usr/bin/grass)

to find the binary.

    locate bin/d.title (i.e., /usr/local/grass-7.0.0svn , after trimming
    off 'bin/d.title')

to find the script directory (actually a file nested two beneath the
script directory, but close enough as a landmark)

and 

   locate html/d.title (i.e., /usr/local/grass-7.0.0svn/docs/html ,
   after trimming off 'd.title')

to find the documentation directory. I'm assuming users with multiple
installations will be savvy enough to pick among the options they get
back from these commands.

Questions for this list:

1. Are the html docs *always* installed in the same place relative to
the scripts? If so, I would only need the binary and script locations,
and can derive the doc path from there.
2. Will this work as I expect? I know it works on my own machine, but
I'm not sure if it is truly portable across Linux flavours.
3. Will it also work on Mac, or are there better ways to get this
information?
4. How would I direct Windows users to find the equivalent locations on
their systems?

Thanks for your help.

Tyler

-- 
plantarum.ca


More information about the grass-user mailing list