[GRASS-dev] Getting version number *before* starting

Vaclav Petras wenzeslaus at gmail.com
Thu Jan 29 15:10:54 PST 2015


On Thu, Jan 29, 2015 at 5:20 PM, Blumentrath, Stefan <
Stefan.Blumentrath at nina.no> wrote:

>  What about grass70 --config?
>
> Cheers
>
> Stefan
>

--config does not work for 64.

For 70 it does not give version, only revision (of library I think). We
should probably change the format to be more parseable. The line order is
really not stable, I'm not sure what other do.

$ grass71 --config
x86_64-unknown-linux-gnu
./configure  --enable-largefile=yes --with-nls --with-cxx --with-readline
--with-pthread --with-proj-share=/usr/share/proj
--with-geos=/usr/bin/geos-config --with-wxwidgets --with-cairo
--with-opengl-libs=/usr/include/GL --with-freetype=yes
--with-freetype-includes=/usr/include/freetype2/ --with-postgresql=yes
--with-postgres-includes=/usr/include/postgresql --with-sqlite=yes
--with-mysql=yes --with-mysql-includes=/usr/include/mysql --with-odbc=no
--with-liblas=yes --with-liblas-config=/usr/bin/liblas-config
gcc
/home/vasek/dev/grass/gcc_trunk/dist.x86_64-unknown-linux-gnu
63639
}}}

70 --help has actually version number on the first line as 64 --version has
but 64 --help does not have the version, except for usage (at least the one
from Ubuntu package).

I'm afraid we have to implement something better. What would it be?


>
> *From:* grass-dev-bounces at lists.osgeo.org [mailto:
> grass-dev-bounces at lists.osgeo.org] *On Behalf Of *Vaclav Petras
> *Sent:* 29. januar 2015 23:10
> *To:* Rainer M Krug
> *Cc:* grass-dev at lists.osgeo.org
> *Subject:* Re: [GRASS-dev] Getting version number *before* starting
>
>
>
>
>
>
>
> On Thu, Jan 29, 2015 at 9:51 AM, Rainer M Krug <Rainer at 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 at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150129/584229ba/attachment.html>


More information about the grass-dev mailing list