[GRASS-dev] Re: [GRASS-SVN] r49533 - grass/branches/develbranch_6/gui/scripts

Hamish hamish_b at yahoo.com
Tue Dec 13 03:05:40 EST 2011


status:

both g.ext .sh and .py merged in 6.4 and 6.5
init.sh was already sync'd (sans some whitespace)
Martin updated init.bat already



Martin wrote:
> well, please don't forget about addons on Windows. Script's are
> installed to `scripts` directory

see below,

> and bat-files to `bin` directory.

this has changed now, right?

> I am not sure what tidy citizen should do in this case
> (because I simply don't understand this idea),

$GRASS_ADDONS_PATH is in the path. So user programs which need to be
in the path get put in that directory. long term survival of msys
or no, I think that everything which is in some context an executable
should end up in $PATH or %PATH%.

> move also bash script to the main dir or not. 

yes, I think so,

what is in the .bat file? is it just the grass-run.bat wrapper?
or is that hardcoding to scripts/$g.module somehow?


[ copied at http://paste.debian.net/149064/ ]

Index: gui/scripts/g.extension.py
===================================================================
--- gui/scripts/g.extension.py  (revision 49698)
+++ gui/scripts/g.extension.py  (working copy)
@@ -422,14 +422,13 @@
     if os.path.exists(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_BIN):
         shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_BIN,
                     os.path.join(options['prefix'], options['extension']) + EXT_BIN)
+    if os.path.exists(os.path.join(options['prefix'], 'scripts', options['extension'])):
+        shutil.move(os.path.join(options['prefix'], 'scripts', options['extension']),
+                    os.path.join(options['prefix'], options['extension']))
     if sys.platform == 'win32':
         if os.path.exists(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_SCT):
             shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + EXT_SCT,
                         os.path.join(options['prefix'], options['extension']) + EXT_SCT)
-    else:
-        if os.path.exists(os.path.join(options['prefix'], 'scripts', options['extension'])):
-            shutil.move(os.path.join(options['prefix'], 'scripts', options['extension']),
-                        os.path.join(options['prefix'], options['extension']))
     
     # move man/ into docs/
     if os.path.exists(os.path.join(options['prefix'], 'man', 'man1', options['extension'] + '.1')):





If there needs to be an install manifest I still think it would be
better to store it locally, but forgetting that for now, does this
look ok to sync grass6.xml?  (generic filename: consider renaming..?)

[ copied to http://paste.debian.net/149065/ ]

Index: tools/addons/build-xml.py
===================================================================
--- tools/addons/build-xml.py   (revision 49697)
+++ tools/addons/build-xml.py   (working copy)
@@ -41,7 +41,7 @@
         fd.write('%s<keywords>%s</keywords>\n' % (' ' * indent, ','.join(keyw)))
         fd.write('%s<binary>\n' % (' ' * indent))
         indent += 4
-        for f in get_module_files(m):
+        for f in get_module_files(m, g7):
             fd.write('%s<file>%s</file>\n' % (' ' * indent, f))
         indent -= 4
         fd.write('%s</binary>\n' % (' ' * indent))
@@ -53,20 +53,28 @@
             print " FAILED"
   
 
-def scandirs(path):
+def scandirs(path, g7 = True):
     flist = list()
     for f in glob.glob(os.path.join(path, '*') ):
         if os.path.isdir(f):
             flist += scandirs(f)
         else:
+            if not g7:
+                if f.find('bin/') == 0:
+                    f.replace('bin/', '', 1)
+                elif f.find('script/') == 0:
+                    f.replace('script/', '', 1)
+                elif f.find('man/') == 0:
+                    f.replace('man/', 'docs/man/', 1)
+
             flist.append(f)
-    
+
     return flist
 
-def get_module_files(name):
+def get_module_files(name, g7 = True):
     os.chdir(os.path.join(sys.argv[1], name))
     return scandirs('*')
-                    
+
 def get_module_metadata(name):
     import grass.script.task as gtask
     path = os.environ['PATH']



what do we need to do, if anything, for building on Macs?
(ISTR there were special compiler FLAGS needed in the past,
these are still in the .sh version but were never added
to the python version. I'm not sure if they actually do
anything though; maybe for i.pr or modules that build
their own libs?)


fwiw--
AFAIK make automatically creates build+install dirs if it
needs them, no need to do that manually AFAIK. (I don't know
if that is also true for etc/ ?)  or was this causing problems??


cheers,
Hamish


More information about the grass-dev mailing list