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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 16 00:25:28 EST 2012


Author: hamish
Date: 2012-02-15 21:25:28 -0800 (Wed, 15 Feb 2012)
New Revision: 50825

Modified:
   grass/trunk/lib/init/grass-xterm-mac
   grass/trunk/lib/init/grass.py
Log:
add relocated MANPATH to startup routine

Modified: grass/trunk/lib/init/grass-xterm-mac
===================================================================
--- grass/trunk/lib/init/grass-xterm-mac	2012-02-16 01:43:49 UTC (rev 50824)
+++ grass/trunk/lib/init/grass-xterm-mac	2012-02-16 05:25:28 UTC (rev 50825)
@@ -30,6 +30,13 @@
 	    echo "export GRASS_ADDON_PATH"
 	fi
 
+	if [ -z "$MANPATH" ] ; then
+	    echo "MANPATH=\"$GISBASE/docs/man:`manpath`\""
+	else
+	    echo "MANPATH=\"$GISBASE/docs/man:$MANPATH\""
+	fi
+	echo "export MANPATH"
+
 	# get command, ignore all other xterm flags
 	while true ; do
 	    if [ "$1" = "-e" ] ; then break ; fi

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2012-02-16 01:43:49 UTC (rev 50824)
+++ grass/trunk/lib/init/grass.py	2012-02-16 05:25:28 UTC (rev 50825)
@@ -341,6 +341,26 @@
     # Set PYTHONPATH to find GRASS Python modules
     path_prepend(gfile('etc', 'python'), 'PYTHONPATH')
     
+    # set path for the GRASS man pages
+    grass_man_path = os.path.join(gisbase, 'docs', 'man')
+    man_path = os.getenv('MANPATH')
+    if man_path:
+	path_prepend(grass_man_path, 'MANPATH')
+    else:
+	try:
+	    p = Popen(['manpath'], stdout = subprocess.PIPE)
+	    s = p.stdout.read()
+	    p.wait()
+	    sys_man_path = s.strip()
+	except:
+	    pass
+
+	if sys_man_path:
+	    os.environ['MANPATH'] = sys_man_path
+	    path_prepend(grass_man_path, 'MANPATH')
+	else:
+	    os.environ['MANPATH'] = grass_man_path
+
     # Add .py (Python) to list of executable extensions to search for in MS-Windows PATH
     if windows:
 	path_append('.PY', 'PATHEXT')



More information about the grass-commit mailing list