[GRASS-SVN] r53374 - grass-addons/tools/addons

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 12 05:54:26 PDT 2012


Author: martinl
Date: 2012-10-12 05:54:26 -0700 (Fri, 12 Oct 2012)
New Revision: 53374

Modified:
   grass-addons/tools/addons/build-xml.py
   grass-addons/tools/addons/compile-xml.sh
   grass-addons/tools/addons/compile.sh
   grass-addons/tools/addons/grass-addons.sh
Log:
update addons support scripts


Modified: grass-addons/tools/addons/build-xml.py
===================================================================
--- grass-addons/tools/addons/build-xml.py	2012-10-12 10:10:36 UTC (rev 53373)
+++ grass-addons/tools/addons/build-xml.py	2012-10-12 12:54:26 UTC (rev 53374)
@@ -3,6 +3,7 @@
 import os
 import sys
 import glob
+from   datetime import datetime
 
 def get_list(addons):
     mlist = os.listdir(os.path.join(addons))
@@ -88,8 +89,13 @@
     import grass.script.core as grass
     fd.write('<?xml version="1.0" encoding="UTF-8"?>\n')
     fd.write('<!DOCTYPE task SYSTEM "grass-addons.dtd">\n') # TODO
-    fd.write('<addons version="%s">\n' % grass.version()['version'].split('.')[0])
+    vInfo = grass.version()
+    fd.write('<addons version="%s" revision="%s" date="%s">\n' % \
+                 (vInfo['version'].split('.')[0],
+                  vInfo['revision'],
+                  datetime.now()))
 
+
 def footer(fd):
     fd.write('</addons>\n')
 

Modified: grass-addons/tools/addons/compile-xml.sh
===================================================================
--- grass-addons/tools/addons/compile-xml.sh	2012-10-12 10:10:36 UTC (rev 53373)
+++ grass-addons/tools/addons/compile-xml.sh	2012-10-12 12:54:26 UTC (rev 53374)
@@ -1,25 +1,27 @@
 #!/bin/sh
 
+DEST=/osgeo/grass/grass-web-public/addons
+
 compile() {
     ./compile.sh $1 $2 $3 1
 }
 
 build_xml() {
     ./build-xml.py $1
+    cp $1/modules.xml $DEST/grass$2/
 }
 
-# recompile GRASS'es
-### $HOME/src/update-grass.sh
-
 # update GRASS Addons SVN
 (cd ..; svn up || (svn cleanup && svn up))
 
+### export GISRC=$HOME/grassdata/demolocation/.grassrc70
+
 # compile AddOns for GRASS 7 and GRASS 6.5
 compile ../../grass7 ~/src/grass_trunk/dist.x86_64-unknown-linux-gnu  ~/.grass7/addons
 compile ../../grass6 ~/src/grass6_devel/dist.x86_64-unknown-linux-gnu ~/.grass6/addons
 
 # create XML file for AddOns
-build_xml ~/.grass7/addons
-build_xml ~/.grass6/addons
+build_xml ~/.grass7/addons 7
+build_xml ~/.grass6/addons 6
 
 exit 0

Modified: grass-addons/tools/addons/compile.sh
===================================================================
--- grass-addons/tools/addons/compile.sh	2012-10-12 10:10:36 UTC (rev 53373)
+++ grass-addons/tools/addons/compile.sh	2012-10-12 12:54:26 UTC (rev 53374)
@@ -10,6 +10,10 @@
 TOPDIR="$2"
 ADDON_PATH="$3"
 
+if [ ! -d "$3" ] ; then
+    mkdir -p "$3"
+fi
+
 if [ -n "$4" ] ; then
     SEP=1 # useful for collecting files (see build-xml.py)
 else

Modified: grass-addons/tools/addons/grass-addons.sh
===================================================================
--- grass-addons/tools/addons/grass-addons.sh	2012-10-12 10:10:36 UTC (rev 53373)
+++ grass-addons/tools/addons/grass-addons.sh	2012-10-12 12:54:26 UTC (rev 53374)
@@ -21,22 +21,25 @@
 recompile_grass() {
     cd $DIR
 
-    for dir in "grass_trunk" "grass6_devel" "grass64_release" ; do
-	cd $dir
+    for gdir in "grass_trunk" "grass6_devel" "grass64_release" ; do
+	cd $gdir
 	svn up
 	make distclean
-	if [ $dir == "grass_trunk" ] ; then 
+	if [ $gdir == "grass_trunk" ] ; then 
 	    num=7
 	else
 	    num=6
 	fi
-	../configures.sh grass$num
+	$DIR/configures.sh grass$num
 	make
 	cd ..
     done
 }
 
-#recompile_grass
+if [ "$2" = "c" ] || [ "$1" = "c" ] ; then
+    recompile_grass
+fi
+
 build_addons $1
 
 exit 0



More information about the grass-commit mailing list