[GRASS-SVN] r73925 - grass/trunk/lib/init

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


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

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

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2019-01-10 12:03:27 UTC (rev 73924)
+++ grass/trunk/lib/init/grass.py	2019-01-10 12:40:39 UTC (rev 73925)
@@ -380,7 +380,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"),
@@ -1904,6 +1904,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