[GRASS-SVN] r49277 - grass/branches/develbranch_6/gui/scripts

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 16 13:00:48 EST 2011


Author: martinl
Date: 2011-11-16 10:00:48 -0800 (Wed, 16 Nov 2011)
New Revision: 49277

Modified:
   grass/branches/develbranch_6/gui/scripts/g.extension.py
Log:
g.extension.py: implement required workaroud - create symlink on GNU/Linux (see r49124)


Modified: grass/branches/develbranch_6/gui/scripts/g.extension.py
===================================================================
--- grass/branches/develbranch_6/gui/scripts/g.extension.py	2011-11-16 16:12:22 UTC (rev 49276)
+++ grass/branches/develbranch_6/gui/scripts/g.extension.py	2011-11-16 18:00:48 UTC (rev 49277)
@@ -470,6 +470,17 @@
             fd = open(html_man, "w")
             fd.write(html_str)
             fd.close()
+
+    # symlink for binaries needed, see http://trac.osgeo.org/grass/changeset/49124
+    src = None
+    if os.path.exists(os.path.join(options['prefix'], 'bin',
+                                   options['extension'])):
+        src = os.path.join(options['prefix'], 'bin', options['extension'])
+    elif os.path.exists(os.path.join(options['prefix'], 'scripts',
+                                     options['extension'])):
+        src = os.path.join(options['prefix'], 'scripts', options['extension'])
+    if src and not os.path.exists(os.path.join(options['prefix'], options['extension'])):
+        os.symlink(src, os.path.join(options['prefix'], options['extension']))
     
     if not os.environ.has_key('GRASS_ADDON_PATH') or \
             not os.environ['GRASS_ADDON_PATH']:
@@ -519,6 +530,9 @@
     except HTTPError:
         remove_extension_std()
 
+    # symlink for binaries needed, see http://trac.osgeo.org/grass/changeset/49124
+    grass.try_remove(os.path.join(options['prefix'], options['extension']))
+    
     grass.message(_("Extension <%s> successfully uninstalled.") % options['extension'])
     
 def remove_extension_std():



More information about the grass-commit mailing list