[GRASS-SVN] r45800 - in grass/trunk: include/Make scripts/g.extension

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 28 09:47:42 EDT 2011


Author: martinl
Date: 2011-03-28 06:47:42 -0700 (Mon, 28 Mar 2011)
New Revision: 45800

Modified:
   grass/trunk/include/Make/Install.make
   grass/trunk/scripts/g.extension/g.extension.py
Log:
fix r45796 to install also wxGUI extension
    Install.make fixed to set up also grass_home


Modified: grass/trunk/include/Make/Install.make
===================================================================
--- grass/trunk/include/Make/Install.make	2011-03-28 13:30:09 UTC (rev 45799)
+++ grass/trunk/include/Make/Install.make	2011-03-28 13:47:42 UTC (rev 45800)
@@ -132,9 +132,14 @@
 sed -e 's#$(GISBASE)#$(INST_DIR)#g' $< > $@
 endef
 
+define fix_grass_home
+sed -e 's#^\(GRASS_HOME.[^=]*\).*#\1= $(INST_DIR)#g' \
+    -e 's#$(GISBASE)#$(INST_DIR)#g' $< > $@
+endef
+
 define fix_grass_arch
-sed -e 's#^ARCH_DISTDIR.*#ARCH_DISTDIR	= $(INST_DIR)#g' \
-    -e 's#^ARCH_BINDIR.*#ARCH_BINDIR	= $(UNIX_BIN)#g' $< > $@
+sed -e 's#^\(ARCH_DISTDIR.[^=]*\).*#\1= $(INST_DIR)#g' \
+    -e 's#^\(ARCH_BINDIR.[^=]*\).*#\1= $(UNIX_BIN)#g' $< > $@
 endef
 
 $(INST_DIR)/$(FONTCAP): $(GISBASE)/$(FONTCAP)
@@ -144,7 +149,7 @@
 	$(call fix_gisbase)
 
 $(INST_DIR)/$(PLATMAKE): $(GISBASE)/$(PLATMAKE)
-	$(call fix_gisbase)
+	$(call fix_grass_home)
 
 $(INST_DIR)/$(GRASSMAKE): $(GISBASE)/$(GRASSMAKE)
 	$(call fix_grass_arch)

Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py	2011-03-28 13:30:09 UTC (rev 45799)
+++ grass/trunk/scripts/g.extension/g.extension.py	2011-03-28 13:47:42 UTC (rev 45800)
@@ -306,10 +306,8 @@
     else:
         url = svnurl + '/gui/wxpython/' + module
         if not flags['s']:
-            grass.warning(_("Installation of wxGUI extension requires -%s flag. "
-                            "Trying to use system administrator rights.") % 's') 
-            flags['s'] = True
-    
+            grass.fatal(_("Installation of wxGUI extension requires -%s flag.") % 's')
+        
     grass.message(_("Fetching '%s' from GRASS-Addons SVN (be patient)...") % module)
     global tmpdir
     os.chdir(tmpdir)
@@ -323,22 +321,29 @@
         grass.fatal(_("GRASS Addons '%s' not found in repository") % module)
     
     os.chdir(os.path.join(tmpdir, module))
+
+    grass.message(_("Compiling '%s'...") % module)    
+    if module not in gui_list:
+        bin_dir  = os.path.join(tmpdir, module, 'bin')
+        docs_dir = os.path.join(tmpdir, module, 'docs')
+        html_dir = os.path.join(docs_dir, 'html')
+        man_dir  = os.path.join(tmpdir, module, 'man')
+        man1_dir = os.path.join(man_dir, 'man1')
+        for d in (bin_dir, docs_dir, html_dir, man_dir, man1_dir):
+            os.mkdir(d)
     
-    bin_dir  = os.path.join(tmpdir, module, 'bin')
-    docs_dir = os.path.join(tmpdir, module, 'docs')
-    html_dir = os.path.join(docs_dir, 'html')
-    man_dir  = os.path.join(tmpdir, module, 'man')
-    man1_dir = os.path.join(man_dir, 'man1')
-    for d in (bin_dir, docs_dir, html_dir, man_dir, man1_dir):
-        os.mkdir(d)
+        ret = grass.call(['make',
+                          'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ '),
+                          'BIN=%s' % bin_dir,
+                          'HTMLDIR=%s' % html_dir,
+                          'MANDIR=%s' % man1_dir],
+                         stdout = outdev)
+    else:
+        ret = grass.call(['make',
+                          'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ ')],
+                         stdout = outdev)
     
-    grass.message(_("Compiling '%s'...") % module)
-    if grass.call(['make',
-                   'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ '),
-                   'BIN=%s' % bin_dir,
-                   'HTMLDIR=%s' % html_dir,
-                   'MANDIR=%s' % man1_dir],
-                   stdout = outdev) != 0:
+    if ret != 0:
         grass.fatal(_('Compilation failed, sorry. Please check above error messages.'))
     
     if no_install or module in gui_list:



More information about the grass-commit mailing list