[GRASS-SVN] r53616 - grass-addons/tools/wingrass-packager

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 30 04:33:36 PDT 2012


Author: martinl
Date: 2012-10-30 04:33:35 -0700 (Tue, 30 Oct 2012)
New Revision: 53616

Modified:
   grass-addons/tools/wingrass-packager/grass_addons.sh
   grass-addons/tools/wingrass-packager/grass_compile.sh
   grass-addons/tools/wingrass-packager/grass_packager.bat
   grass-addons/tools/wingrass-packager/grass_svn_info.sh
Log:
wingrass script: support osgeo4w dir postfix

Modified: grass-addons/tools/wingrass-packager/grass_addons.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_addons.sh	2012-10-30 11:18:46 UTC (rev 53615)
+++ grass-addons/tools/wingrass-packager/grass_addons.sh	2012-10-30 11:33:35 UTC (rev 53616)
@@ -5,6 +5,8 @@
 GISBASE_PREFIX=/c/osgeo4w/usr/src
 ADDON_PREFIX=/c/Users/landa/grass_packager
 
+PATH_ORIG=`echo $PATH`
+
 cd $SVN_PATH
 svn up || (svn cleanup && svn up)
 
@@ -22,8 +24,8 @@
 }
 
 function compile {
-    path=`echo $PATH`
-    export PATH=$PATH:/c/OSGeo4W/apps/msys/bin:$2/dist.i686-pc-mingw32/bin:$2/dist.i686-pc-mingw32/scripts
+    export PATH=$PATH:/c/OSGeo4W$4/apps/msys/bin:/c/OSGeo4W$4/bin:$2/dist.i686-pc-mingw32/bin:$2/dist.i686-pc-mingw32/scripts
+    export PYTHONHOME=/c/OSGeo4W$4/apps/Python27
     rm -rf $3
     $SVN_PATH/tools/addons/compile.sh $1 $2 $3 1
     cd $3
@@ -45,18 +47,16 @@
 	cd ..
 	md5sum $mod.zip > ${mod}.md5sum
     done
-    export PATH=$path
+    export PATH=$PATH_ORIG
 }
 
-export PATH=/c/OSGeo4W/apps/msys/bin:/c/OSGeo4W/bin:$PATH
-export PYTHONHOME=/c/OSGeo4W/apps/Python27
 export LANGUAGE=C
 
 if test -z $1 ; then
     # dev packages
     compile $SVN_PATH/grass6 $GISBASE_PREFIX/grass64_release $ADDON_PREFIX/grass64/addons
     compile $SVN_PATH/grass6 $GISBASE_PREFIX/grass6_devel    $ADDON_PREFIX/grass65/addons
-    compile $SVN_PATH/grass7 $GISBASE_PREFIX/grass_trunk     $ADDON_PREFIX/grass70/addons
+    compile $SVN_PATH/grass7 $GISBASE_PREFIX/grass_trunk     $ADDON_PREFIX/grass70/addons _g7
 else
     compile $SVN_PATH/grass6 $GISBASE_PREFIX/grass$1         $ADDON_PREFIX/grass$1/addons
 fi

Modified: grass-addons/tools/wingrass-packager/grass_compile.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_compile.sh	2012-10-30 11:18:46 UTC (rev 53615)
+++ grass-addons/tools/wingrass-packager/grass_compile.sh	2012-10-30 11:33:35 UTC (rev 53616)
@@ -1,20 +1,23 @@
 #!/bin/sh
 # Compile GRASS 6.4, 6.5 and 7.0 (update source code from SVN repository)
 
-SRC=/osgeo4w/usr/src
+SRC=/usr/src
 PACKAGEDIR=mswindows/osgeo4w/package
+PATH_ORIG=`echo $PATH`
 
 function rm_package_7 {
-    for f in `/c/OSGeo4W/apps/msys/bin/find $PACKAGEDIR/grass*.tar.bz2 -mtime +7 2>/dev/null`; do
+    for f in `/c/osgeo4w$1/apps/msys/bin/find $PACKAGEDIR/grass*.tar.bz2 -mtime +7 2>/dev/null`; do
         rm -rfv $f
     done
 }
 
 function compile {
-    cd $SRC/$1
+    export PATH=$PATH_ORIG:/c/osgeo4w$3/apps/msys/bin
+
+    cd /c/osgeo4w$3/$SRC/$1
     svn up || (svn cleanup && svn up)
     
-    rm_package_7 
+    rm_package_7 $3 
     curr=`ls -t $PACKAGEDIR/ 2>/dev/null | head -n1 | cut -d'-' -f5 | cut -d'.' -f1`
     if [ $? -eq 0 ]; then
 	num=$(($curr+1))
@@ -26,18 +29,18 @@
     
     echo "Compiling $1 ($package)..."
     rm -f mswindows/osgeo4w/configure-stamp
-    ./mswindows/osgeo4w/package.sh $package $2
+    ./mswindows/osgeo4w/package.sh $package $2 $3
+
+    export PATH=$PATH_ORIG
 }
 
-export PATH=$PATH:/c/OSGeo4W/apps/msys/bin
-
 if test -z $1 ; then
     # dev packages
     compile grass64_release 64-dev
-    compile grass6_devel 65-dev
-    compile grass_trunk 70-dev
+    compile grass6_devel    65-dev
+    compile grass_trunk     70-dev _g7
 else
-    compile grass$1 $1
+    compile grass$1         $1
 fi
 
 exit 0

Modified: grass-addons/tools/wingrass-packager/grass_packager.bat
===================================================================
--- grass-addons/tools/wingrass-packager/grass_packager.bat	2012-10-30 11:18:46 UTC (rev 53615)
+++ grass-addons/tools/wingrass-packager/grass_packager.bat	2012-10-30 11:33:35 UTC (rev 53616)
@@ -5,7 +5,7 @@
 rem Compile GRASS versions
 rmdir /s /q C:\OSGeo4W\apps\grass\grass-6.4.3svn
 rmdir /s /q C:\OSGeo4W\apps\grass\grass-6.5.svn
-rmdir /s /q C:\OSGeo4W\apps\grass\grass-7.0.svn
+rmdir /s /q C:\OSGeo4W_g7\apps\grass\grass-7.0.svn
 rem native & osgeo4w
 C:\OSGeo4W\apps\msys\bin\bash.exe C:\Users\landa\grass_packager\grass_compile.sh
 
@@ -15,7 +15,7 @@
 if exist .\grass65 rmdir /S/Q .\grass65
 xcopy C:\OSGeo4W\usr\src\grass6_devel\mswindows\* .\grass65 /S/V/F/I
 if exist .\grass70 rmdir /S/Q .\grass70
-xcopy C:\OSGeo4W\usr\src\grass_trunk\mswindows\* .\grass70 /S/V/F/I
+xcopy C:\OSGeo4W_g7\usr\src\grass_trunk\mswindows\* .\grass70 /S/V/F/I
 
 cd .\grass64
 call .\GRASS-Packager.bat
@@ -31,7 +31,9 @@
 C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_svn_info.sh
 
 C:\DevTools\makensis.exe .\grass64\GRASS-Installer.nsi
+
 C:\DevTools\makensis.exe .\grass65\GRASS-Installer.nsi
+
 C:\DevTools\makensis.exe .\grass70\GRASS-Installer.nsi
 
 C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_md5sum.sh

Modified: grass-addons/tools/wingrass-packager/grass_svn_info.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_svn_info.sh	2012-10-30 11:18:46 UTC (rev 53615)
+++ grass-addons/tools/wingrass-packager/grass_svn_info.sh	2012-10-30 11:33:35 UTC (rev 53616)
@@ -1,20 +1,25 @@
 #!/bin/sh
 # Update SVN version info
 
-SRC=/osgeo4w/usr/src
+SRC=/usr/src
 PACKAGEDIR=mswindows/osgeo4w/package
 HOME=/c/Users/landa/grass_packager
 
 function update {
-    cd $SRC/$1
+    if [ "$1" = "grass_trunk" ] ; then
+	cd /c/osgeo4w_g7/$SRC/$1
+    else
+	cd /c/osgeo4w/$SRC/$1
+    fi
+    
     REV=`svn info | grep 'Last Changed Rev:' | cut -d':' -f2 | tr -d ' '`
-    if test -z $3 ; then
+    if test -z $4 ; then
 	NUM=`ls -t $PACKAGEDIR/ 2>/dev/null | head -n1 | cut -d'-' -f5 | cut -d'.' -f1`
 	if [ "x$NUM" = "x" ]; then
 	    NUM=1
 	fi
     else
-	NUM=$3
+	NUM=$4
     fi
     
     exec 3<include/VERSION 
@@ -49,10 +54,10 @@
 if test -z $1 ; then
     # dev packages
     update grass64_release grass64
-    update grass6_devel grass65
-    update grass_trunk grass70
+    update grass6_devel    grass65
+    update grass_trunk     grass70
 else
-    update grass$1 grass$1 $2
+    update grass$1         grass$1 $2
 fi
 
 exit 0



More information about the grass-commit mailing list