What about grass70 --config?
Cheers
Stefan

From: grass-dev-boun...@lists.osgeo.org 
[mailto:grass-dev-boun...@lists.osgeo.org] On Behalf Of Vaclav Petras
Sent: 29. januar 2015 23:10
To: Rainer M Krug
Cc: grass-dev@lists.osgeo.org
Subject: Re: [GRASS-dev] Getting version number *before* starting



On Thu, Jan 29, 2015 at 9:51 AM, Rainer M Krug 
<rai...@krugs.de<mailto:rai...@krugs.de>> wrote:
Hi

I would, for implementation in spgrass7 in R, to be able to get the version
number of GRASS GIS before starting GRASS.

I know about the --version parameter of grass command.

{{{
$ grass64 --version

GRASS GIS 6.4.4

Geographic Resources Analysis Support System (GRASS) is Copyright,
1999-2014 by the GRASS Development Team, and licensed under terms of the
GNU General Public License (GPL) version >=2.

This GRASS 6.4.4 release is coordinated and produced by the...
}}}

Unfortunately for GRASS GIS 7 it is giving more the license and about then the 
version:

{{{
$ grass71 --version

Geographic Resources Analysis Support System (GRASS) is Copyright,
1999-2014 by the GRASS Development Team, and licensed under terms of the
GNU General Public License (GPL) version >=2.

This GRASS 7.1.svn release is coordinated and produced by
}}}

Although, I'm running 71 from source code, so it might be different.
To get general idea, here are examples what other projects have in --version:

{{{
gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
...
}}}

{{{
pandoc --version
pandoc 1.12.2.1
Compiled with texmath 0.6.5.2, highlighting-kate 0.5.5.1.
Syntax highlighting is supported for the following languages:
...
}}}
I know that in the file

,----
| GRASS_BASE_DIRECTORY/etc/VERSIONNUMBER
`----

the version number is stored, but I have two questions:

1) is this the same between systems (I saw it in Mac Linux and Windows)?
2) I assume the location of this file is very un-likely to change?
3) can the internal structure of the GDRASS_BASE_DIRECTORY be configured
during the build process (particularly the bin/ and the location of
VERSIONNUMBER), and if yes, how can I obtain the location of these folders?

So: would there be any downside in just reading this file to determine
the version of GRASS GIS, as the grass startup script seems to be
reading from that file as well?

Thanks,

Rainer

--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org<mailto:grass-dev@lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/grass-dev

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to