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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 18 12:33:24 PDT 2012


Author: martinl
Date: 2012-10-18 12:33:23 -0700 (Thu, 18 Oct 2012)
New Revision: 53480

Modified:
   grass/branches/develbranch_6/gui/scripts/g.extension.py
Log:
g.extension.py: update modules.xml file correctly also for shell scripts


Modified: grass/branches/develbranch_6/gui/scripts/g.extension.py
===================================================================
--- grass/branches/develbranch_6/gui/scripts/g.extension.py	2012-10-18 19:14:27 UTC (rev 53479)
+++ grass/branches/develbranch_6/gui/scripts/g.extension.py	2012-10-18 19:33:23 UTC (rev 53480)
@@ -316,6 +316,10 @@
                 indent += 4
                 for fnode in bnode.findall('file'):
                     fpath = fnode.text.split(os.path.sep)
+                    if fpath[0] == 'man' and sys.platform == 'win32':
+                        # no manual pages on MS Windows
+                        continue
+                    
                     if not flags['s']: # tidy citizen hacks
                         if fpath[0] in ('bin', 'scripts'):
                             del fpath[0]
@@ -325,6 +329,13 @@
                     fo.write('%s<file>%s</file>\n' % \
                                  (' ' * indent, os.path.join(options['prefix'],
                                                              os.path.sep.join(fpath))))
+                    
+                    if sys.platform == 'win32' and os.path.splitext(fpath[-1])[1] == '.bat':
+                        spath = fpath[:-1] + [os.path.splitext(fpath[-1])[0]]
+                        fo.write('%s<file>%s</file>\n' % \
+                                     (' ' * indent, os.path.join(options['prefix'],
+                                                                 os.path.sep.join(spath))))
+                    
                 indent -= 4 
                 fo.write('%s</binary>\n' % (' ' * indent))
             libgisRev = grass.version()['libgis_revision']
@@ -359,7 +370,7 @@
                         if path[0] == 'bin':
                             path[-1] += '.exe'
                         if path[0] == 'scripts':
-                            path[-1] += '.py'
+                            path[-1] += '.bat'
                     fList.append(os.path.sep.join(path))
             
             desc, keyw = get_optional_params(mnode)



More information about the grass-commit mailing list