[GRASS-SVN] r49549 - grass-addons/tools/addons
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 5 10:38:45 EST 2011
Author: martinl
Date: 2011-12-05 07:38:45 -0800 (Mon, 05 Dec 2011)
New Revision: 49549
Modified:
grass-addons/tools/addons/build-xml.py
grass-addons/tools/addons/compile-xml.sh
Log:
wingrass-addons: fix scripts for creating xml metadata files
Modified: grass-addons/tools/addons/build-xml.py
===================================================================
--- grass-addons/tools/addons/build-xml.py 2011-12-05 12:49:48 UTC (rev 49548)
+++ grass-addons/tools/addons/build-xml.py 2011-12-05 15:38:45 UTC (rev 49549)
@@ -6,12 +6,12 @@
def get_list(addons):
mlist = os.listdir(os.path.join(addons))
- for f in ('log', 'make.log', 'modules.xml'):
+ for f in ('log', 'modules.xml'):
mlist.remove(f)
mlist.sort()
return mlist
-def start_grass(mlist, g7 = True):
+def start_grass(g7 = True):
if g7:
ver = 'grass_trunk'
else:
@@ -23,10 +23,10 @@
location = "demolocation"
mapset = "PERMANENT"
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))
+ sys.path.insert(0, os.path.join(os.environ['GISBASE'], "etc", "python"))
import grass.script as grass
import grass.script.setup as gsetup
-
+
gsetup.init(gisbase,
gisdbase, location, mapset)
@@ -98,13 +98,18 @@
sys.exit("Usage: %s path_to_addons" % sys.argv[0])
addons = sys.argv[1]
-
+ try:
+ version = os.path.split(addons)[-2][-1]
+ g7 = version == '7'
+ except:
+ g7 = True
+
path = os.path.join(addons, 'modules.xml')
print "-----------------------------------------------------"
print "Creating XML file '%s'..." % path
print "-----------------------------------------------------"
fd = open(path, 'w')
- start_grass(True)
+ start_grass(g7)
header(fd)
parse_modules(fd, get_list(addons))
Modified: grass-addons/tools/addons/compile-xml.sh
===================================================================
--- grass-addons/tools/addons/compile-xml.sh 2011-12-05 12:49:48 UTC (rev 49548)
+++ grass-addons/tools/addons/compile-xml.sh 2011-12-05 15:38:45 UTC (rev 49549)
@@ -12,8 +12,7 @@
### $HOME/src/update-grass.sh
# update GRASS Addons SVN
-# WARNING: create symlinks in grass6 first!
-(cd ..; svn up)
+(cd ..; svn up || (svn cleanup && svn up))
# compile AddOns for GRASS 7 and GRASS 6.5
compile ../../grass7 ~/src/grass_trunk/dist.x86_64-unknown-linux-gnu ~/.grass7/addons
More information about the grass-commit
mailing list