[GRASS-SVN] r59799 - grass/branches/releasebranch_6_4/gui/scripts

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 19 05:36:33 PDT 2014


Author: martinl
Date: 2014-04-19 05:36:33 -0700 (Sat, 19 Apr 2014)
New Revision: 59799

Modified:
   grass/branches/releasebranch_6_4/gui/scripts/g.extension.py
Log:
WinGRASS: fix g.extension.py to install exe addons

Modified: grass/branches/releasebranch_6_4/gui/scripts/g.extension.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/scripts/g.extension.py	2014-04-19 12:16:36 UTC (rev 59798)
+++ grass/branches/releasebranch_6_4/gui/scripts/g.extension.py	2014-04-19 12:36:33 UTC (rev 59799)
@@ -627,17 +627,17 @@
             shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + '.py' + EXT_SCT,
                         os.path.join(options['prefix'], options['extension']) + EXT_SCT)
             is_python_script = True
-
         # fix script path. may be it is better to just write out a new
-        #   windows_launch.bat template manually, since it's just a one-liner.
-        for line in fileinput.FileInput(os.path.join(options['prefix'],
-                                       options['extension']) + EXT_SCT,
-                                       inplace = True):
-            line = line.replace("/scripts", "")
-            line = line.replace("%GISBASE%", "%GRASS_ADDON_PATH%") # options['prefix'])
-            if is_python_script:
-                line = line.replace("GRASS_SH", "GRASS_PYTHON")
-            print line
+        # windows_launch.bat template manually, since it's just a one-liner.
+        if os.path.exists(os.path.join(options['prefix'], options['extension']) + EXT_SCT):
+            for line in fileinput.FileInput(os.path.join(options['prefix'],
+                                                         options['extension']) + EXT_SCT,
+                                            inplace = True):
+                line = line.replace("/scripts", "")
+                line = line.replace("%GISBASE%", "%GRASS_ADDON_PATH%") # options['prefix'])
+                if is_python_script:
+                    line = line.replace("GRASS_SH", "GRASS_PYTHON")
+                print line
     
     # move man/ into docs/
     if os.path.exists(os.path.join(options['prefix'], 'man', 'man1', options['extension'] + '.1')):



More information about the grass-commit mailing list