[GRASS-SVN] r73926 - grass/branches/releasebranch_7_6/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 10 04:40:53 PST 2019


Author: neteler
Date: 2019-01-10 04:40:53 -0800 (Thu, 10 Jan 2019)
New Revision: 73926

Modified:
   grass/branches/releasebranch_7_6/lib/init/grass.py
Log:
grass.py: added --config svn_revision

Modified: grass/branches/releasebranch_7_6/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_6/lib/init/grass.py	2019-01-10 12:40:39 UTC (rev 73925)
+++ grass/branches/releasebranch_7_6/lib/init/grass.py	2019-01-10 12:40:53 UTC (rev 73926)
@@ -347,7 +347,7 @@
     gui=_("use $DEFAULT_GUI graphical user interface"),
     gui_detail=_("and set as default"),
     config=_("print GRASS configuration parameters"),
-    config_detail=_("options: arch,build,compiler,path,revision,version"),
+    config_detail=_("options: arch,build,compiler,path,revision,svn_revision,version"),
     params=_("Parameters"),
     gisdbase=_("initial GRASS GIS database directory"),
     gisdbase_detail=_("directory containing Locations"),
@@ -1842,6 +1842,15 @@
             filerev.close()
             sys.stdout.write(
                 "%s\n" % val[0].split(':')[1].rstrip('$"\n').strip())
+        elif arg == 'svn_revision':
+            filerev = open(gpath('etc', 'VERSIONNUMBER'))
+            linerev = filerev.readline().rstrip('\n')
+            filerev.close()
+            try:
+               revision = linerev.split(' ')[1]
+               sys.stdout.write("%s\n" % revision[1:])
+            except:
+               sys.stdout.write("No SVN revision defined\n")
         elif arg == 'version':
             sys.stdout.write("%s\n" % grass_version)
         else:



More information about the grass-commit mailing list