[GRASS-SVN] r38265 - grass/trunk/scripts/g.extension

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 5 14:46:46 EDT 2009


Author: martinl
Date: 2009-07-05 14:46:46 -0400 (Sun, 05 Jul 2009)
New Revision: 38265

Modified:
   grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: print warning if module already installed


Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py	2009-07-05 18:37:19 UTC (rev 38264)
+++ grass/trunk/scripts/g.extension/g.extension.py	2009-07-05 18:46:46 UTC (rev 38265)
@@ -115,6 +115,9 @@
     grass.try_rmdir(tmpdir)
 
 def install_extension(gisbase, module):
+    if grass.find_program(module):
+        grass.warning("Extension '%s' already installed. Will be updated..." % module)
+    
     classchar = module.split('.', 1)[0]
     moduleclass = expand_module_class_name(classchar)
     global svnurl_addons
@@ -166,7 +169,7 @@
         if os.path.isfile(file):
             os.remove(file)
                     
-    grass.message("'%s' successfully removed." % module)
+    grass.message("'%s' successfully uninstalled." % module)
     
 def main():
     # check dependecies



More information about the grass-commit mailing list