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

2015-10-30 Thread Markus Neteler
On Fri, Oct 30, 2015 at 4:09 PM, Tyler Smith  wrote:
> On Fri, Oct 30, 2015, at 06:57 AM, Markus Neteler wrote:
> Marvelous, thanks! To confirm, given the path returned by grass70
> --config, can I count on the helper programs being under /bin and
> /scripts, and the html docs will be under /docs/html? That's
> much easier than looking for all three locations.

Mostly yes but it may be that some (Linux) distros put the documentation under

/usr/share/man/man1/

> What about the grass binary itself? Is there a way for GRASS to tell me
> that too, or is there a Windows version of `which`?

For Windows, I see some options discussed here (and elsewhere):

http://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-the-windows-command-line


Best
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2015-10-30 Thread Rainer M Krug
Markus Neteler  writes:

> On Thu, Oct 29, 2015 at 3:28 PM, Tyler Smith  wrote:
>> 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.
>
> Right.
>
> ...
>>  a reasonably robust way for users to find
>> the information is:
>
> Please better use this (works "everywhere", also on non-Linux
> systems): ask GRASS itself where it is - of course the startup script
> needs to be in the PATH:
>

You could always ask for the path to the grass startup script.

> # Linux
> grass70 --config path
> /usr/local/grass-7.0.2svn
>
> # Windows
> C:\>grass70.bat --config path
> C:\OSGeo4W\apps\grass\grass-7.0
>
> and so on.

I always forget about the --config options

But how robust is this? I think it is also only supported from 7 onwards
(at least my 6.4.4 installation does not know the argument --config)?

Rainer


>
> HTH,
> Markus
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


signature.asc
Description: PGP signature
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2015-10-30 Thread Markus Neteler
On Fri, Oct 30, 2015 at 12:59 PM, Rainer M Krug  wrote:
> Markus Neteler  writes:
...
> I always forget about the --config options
>
> But how robust is this?

Robust to my knowledge. There is not much magic behind :-)

> I think it is also only supported from 7 onwards

Right.

> (at least my 6.4.4 installation does not know the argument --config)?

Unless we add it also there (perhaps some effort since that is still a
bash start script).

For now, you could conditionalize on G7, the start script name should
carry the version number anyway.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2015-10-30 Thread Tyler Smith
On Fri, Oct 30, 2015, at 06:57 AM, Markus Neteler wrote:
> 
> Please better use this (works "everywhere", also on non-Linux
> systems): ask GRASS itself where it is - of course the startup script
> needs to be in the PATH:
> 
> # Linux
> grass70 --config path
> /usr/local/grass-7.0.2svn
> 
> # Windows
> C:\>grass70.bat --config path
> C:\OSGeo4W\apps\grass\grass-7.0

Marvelous, thanks! To confirm, given the path returned by grass70
--config, can I count on the helper programs being under /bin and
/scripts, and the html docs will be under /docs/html? That's
much easier than looking for all three locations.

What about the grass binary itself? Is there a way for GRASS to tell me
that too, or is there a Windows version of `which`?

Best,

Tyler
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2015-10-30 Thread Markus Neteler
On Thu, Oct 29, 2015 at 3:28 PM, Tyler Smith  wrote:
> 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.

Right.

...
>  a reasonably robust way for users to find
> the information is:

Please better use this (works "everywhere", also on non-Linux
systems): ask GRASS itself where it is - of course the startup script
needs to be in the PATH:

# Linux
grass70 --config path
/usr/local/grass-7.0.2svn

# Windows
C:\>grass70.bat --config path
C:\OSGeo4W\apps\grass\grass-7.0

and so on.

HTH,
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user