[GRASS-SVN] r45801 - grass/branches/develbranch_6/gui/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 28 10:21:01 EDT 2011
Author: martinl
Date: 2011-03-28 07:21:01 -0700 (Mon, 28 Mar 2011)
New Revision: 45801
Modified:
grass/branches/develbranch_6/gui/scripts/g.extension.py
Log:
sync g.extension with trunk
Modified: grass/branches/develbranch_6/gui/scripts/g.extension.py
===================================================================
--- grass/branches/develbranch_6/gui/scripts/g.extension.py 2011-03-28 13:47:42 UTC (rev 45800)
+++ grass/branches/develbranch_6/gui/scripts/g.extension.py 2011-03-28 14:21:01 UTC (rev 45801)
@@ -96,9 +96,7 @@
# temp dir
remove_tmpdir = True
-tmpdir = grass.tempfile()
-grass.try_remove(tmpdir)
-os.mkdir(tmpdir)
+tmpdir = grass.tempdir()
def check():
for prog in ('svn', 'make', 'install', 'gcc'):
@@ -308,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)
@@ -325,36 +321,43 @@
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)
- grass.message(_("Compiling '%s'...") % module)
- if grass.call(['make',
- 'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ ')],
- stdout = outdev) != 0:
+ 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)
+
+ if ret != 0:
grass.fatal(_('Compilation failed, sorry. Please check above error messages.'))
if no_install or module in gui_list:
return
grass.message(_("Installing '%s'...") % module)
- # replace with something better
- file = os.path.join(prefix, 'test')
- f = open(file, "w")
- f.close()
- os.remove(file)
-
- if not flags['s']:
- ret = grass.call(['make',
- 'MODULE_TOPDIR=%s' % gisbase,
- 'INST_DIR=%s' % prefix,
- 'install'],
- stdout = outdev)
- else:
- ret = grass.call(['sudo', 'make',
- 'MODULE_TOPDIR=%s' % gisbase,
- 'INST_DIR=%s' % prefix,
- 'install'],
- stdout = outdev)
+ ret = grass.call(['make',
+ 'MODULE_TOPDIR=%s' % gisbase,
+ 'ARCH_DISTDIR=%s' % os.path.join(tmpdir, module),
+ 'INST_DIR=%s' % prefix,
+ 'install'],
+ stdout = outdev)
+
if ret != 0:
grass.warning(_('Installation failed, sorry. Please check above error messages.'))
else:
More information about the grass-commit
mailing list