[GRASS-SVN] r67096 - grass-addons/tools/wingrass-packager
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 13 06:05:27 PST 2015
Author: martinl
Date: 2015-12-13 06:05:27 -0800 (Sun, 13 Dec 2015)
New Revision: 67096
Modified:
grass-addons/tools/wingrass-packager/grass_addons.sh
grass-addons/tools/wingrass-packager/grass_compile.sh
grass-addons/tools/wingrass-packager/grass_copy_wwwroot.sh
grass-addons/tools/wingrass-packager/grass_md5sum.sh
grass-addons/tools/wingrass-packager/grass_osgeo4w.sh
grass-addons/tools/wingrass-packager/grass_packager.bat
grass-addons/tools/wingrass-packager/grass_svn_info.sh
Log:
winGRASS: update build script to new msys2 environment (work in progress)
Modified: grass-addons/tools/wingrass-packager/grass_addons.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_addons.sh 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_addons.sh 2015-12-13 14:05:27 UTC (rev 67096)
@@ -1,37 +1,39 @@
#!/bin/sh
-# Compile AddOns GRASS versions
+# Compile GRASS GIS Addons
+#
+# Options:
+# - platform (32 or 64)
+# - src postfix, eg. '_trunk'
-SVN_PATH=/c/osgeo4w/usr/src/grass_addons
-GISBASE_PATH=/c/osgeo4w/usr/src
+if test -z "$1"; then
+ echo "platform not specified"
+ exit 1
+fi
+PLATFORM=$1
+export PATH=/c/msys${PLATFORM}/usr/bin:/c/msys${PLATFORM}/mingw${PLATFORM}/bin:/c/osgeo4w${PLATFORM}/bin:${PATH}
+export PYTHONHOME=/c/OSGeo4W${PLATFORM}/apps/Python27
+export LANGUAGE=C
+
+SVN_PATH=/c/osgeo4w${PLATFORM}/usr/src/grass_addons
+GISBASE_PATH=/c/osgeo4w${PLATFORM}/usr/src
ADDON_PATH=/c/Users/landa/grass_packager
+if [ "$PLATFORM" = "32" ] ; then
+ PLATFORM_DIR=x86
+else
+ PLATFORM_DIR=x86_64
+fi
-PATH_ORIG=`echo $PATH`
+cd $SVN_PATH
+svn up || (svn cleanup && svn up)
-(cd $SVN_PATH && \
- export PATH=$PATH_ORIG:/c/osgeo4w$3/apps/msys/bin:/c/Subversion/bin && \
- svn up || (svn cleanup && svn up) \
-)
-
-# see http://lists.osgeo.org/pipermail/grass-dev/2011-December/056938.html
-function tidy_citizen {
- # move script/ and bin/ to main dir
- mv bin/* .
- mv scripts/* .
-
- # move man/ into docs/
- mv man docs/
-
- # if empty, rmdir bin, etc, man, scripts
- rmdir bin etc scripts
-}
-
function compile {
- 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:/c/subversion/bin/svn
- export PYTHONHOME=/c/OSGeo4W$4/apps/Python27
+ SRC_ADDONS=$1
+ SRC_GRASS=$2
+ DST_DIR=$3
- rm -rf $3
- $SVN_PATH/tools/addons/compile.sh $1 $2 $3 1
- cd $3
+ rm -rf $DST_DIR
+ $SVN_PATH/tools/addons/compile.sh $SRC_ADDONS $SRC_GRASS $DST_DIR 1
+ cd $DST_DIR
for d in `ls -d */`; do
mod=${d%%/}
if [ $mod == "logs" ] ; then
@@ -49,29 +51,24 @@
sed "s/GISBASE/$replace_gisbase/" $f > tmp
mv tmp $f
done
- # if [ `echo $1 | sed -e 's/\(^.*\)\(.$\)/\2/'` = "6" ] ; then
- # tidy_citizen
- # fi
zip -r $mod.zip *
mv $mod.zip ..
cd ..
md5sum $mod.zip > ${mod}.md5sum
done
- export PATH=$PATH_ORIG
}
-export LANGUAGE=C
-
-if test -z $1 ; then
+if test -z $2 ; then
### compile $SVN_PATH/grass6 $GISBASE_PATH/grass644 $ADDON_PATH/grass644/addons
### compile $SVN_PATH/grass6 $GISBASE_PATH/grass64_release $ADDON_PATH/grass64/addons
- compile $SVN_PATH/grass7 $GISBASE_PATH/grass700 $ADDON_PATH/grass700/addons
- compile $SVN_PATH/grass7 $GISBASE_PATH/grass701 $ADDON_PATH/grass701/addons
- compile $SVN_PATH/grass7 $GISBASE_PATH/grass702 $ADDON_PATH/grass702/addons
- compile $SVN_PATH/grass7 $GISBASE_PATH/grass70_release $ADDON_PATH/grass70/addons
- compile $SVN_PATH/grass7 $GISBASE_PATH/grass_trunk $ADDON_PATH/grass71/addons
+ # TODO: enable later
+ #compile $SVN_PATH/grass7 $GISBASE_PATH/grass700 $ADDON_PATH/grass700/addons
+ #compile $SVN_PATH/grass7 $GISBASE_PATH/grass701 $ADDON_PATH/grass701/addons
+ #compile $SVN_PATH/grass7 $GISBASE_PATH/grass702 $ADDON_PATH/grass702/addons
+ compile $SVN_PATH/grass7 $GISBASE_PATH/grass70_release ${ADDON_PATH}/${PLATFORM_DIR}/grass70/addons
+ compile $SVN_PATH/grass7 $GISBASE_PATH/grass_trunk ${ADDON_PATH}/${PLATFORM_DIR}/grass71/addons
else
- compile $SVN_PATH/grass6 $GISBASE_PATH/grass$1 $ADDON_PATH/grass$1/addons
+ compile $SVN_PATH/grass6 $GISBASE_PATH/grass$2 ${ADDON_PATH}/${PLATFORM_DIR}/grass$2/addons
fi
exit 0
Modified: grass-addons/tools/wingrass-packager/grass_compile.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_compile.sh 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_compile.sh 2015-12-13 14:05:27 UTC (rev 67096)
@@ -1,10 +1,21 @@
#!/bin/sh
# Compile GRASS versions (update source code from SVN repository)
+#
+# Options:
+# - platform (32 or 64)
+# - src postfix, eg. '_trunk'
+# - pkg postfix, eg. '-daily'
-SRC=/usr/src
+SRC_DIR=usr/src
PACKAGEDIR=mswindows/osgeo4w/package
-PATH_ORIG=`echo $PATH`
+if test -z "$1"; then
+ echo "platform not specified"
+ exit 1
+fi
+PLATFORM=$1
+export PATH=/c/msys${PLATFORM}/usr/bin:/c/msys${PLATFORM}/mingw${PLATFORM}/bin:/c/osgeo4w${PLATFORM}/bin:${PATH}
+
function rm_package_7 {
for f in `/c/osgeo4w$1/apps/msys/bin/find $PACKAGEDIR/grass*.tar.bz2 -mtime +7 2>/dev/null`; do
rm -rfv $f
@@ -12,12 +23,13 @@
}
function compile {
- export PATH=$PATH_ORIG:/c/osgeo4w$3/apps/msys/bin:/c/Subversion/bin
+ GRASS_DIR=$1
+ PACKAGE_POSTFIX=$2
- cd /c/osgeo4w$3/$SRC/$1
+ cd /c/msys${PLATFORM}/$SRC_DIR/$GRASS_DIR
svn up || (svn cleanup && svn up)
- rm_package_7 $3
+ rm_package_7 $PLATFORM
curr=`ls -t $PACKAGEDIR/ 2>/dev/null | head -n1 | cut -d'-' -f5 | cut -d'.' -f1`
if [ $? -eq 0 ]; then
num=$(($curr+1))
@@ -27,21 +39,18 @@
rev=`svn info | grep 'Last Changed Rev:' | cut -d':' -f2 | tr -d ' '`
package="r$rev-$num"
- echo "Compiling $1 ($package)..."
+ echo "Compiling ${PLATFORM}bit $GRASS_DIR ($package)..."
rm -f mswindows/osgeo4w/configure-stamp
- ./mswindows/osgeo4w/package.sh $package $2 $3
-
- export PATH=$PATH_ORIG
+ PACKAGE_POSTFIX=$PACKAGE_POSTFIX OSGEO4W_POSTFIX=$PLATFORM ./mswindows/osgeo4w/package.sh
}
-if test -z $1 ; then
+if test -z $2 ; then
# dev packages
### compile grass64_release 64-dev
- ### compile grass6_devel 65-dev
- compile grass70_release -dev
+ compile grass70_release -dev
compile grass_trunk -daily
else
- compile grass$1 $2
+ compile grass$2 $3
fi
exit 0
Modified: grass-addons/tools/wingrass-packager/grass_copy_wwwroot.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_copy_wwwroot.sh 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_copy_wwwroot.sh 2015-12-13 14:05:27 UTC (rev 67096)
@@ -1,40 +1,66 @@
#!/bin/sh
# Copy binaries to www server
+#
+# Options:
+# - platform (32 or 64)
+# - src version, eg. 700
+# - version, eg. 7.0.1
WWWDIR=/c/inetpub/wwwroot/wingrass
HOME=/c/Users/landa/grass_packager
+if test -z "$1"; then
+ echo "platform not specified"
+ exit 1
+fi
+PLATFORM=$1
+export PATH=/c/msys${PLATFORM}/usr/bin:/c/msys${PLATFORM}/mingw${PLATFORM}/bin:/c/osgeo4w${PLATFORM}/bin:${PATH}
+if [ "$PLATFORM" = "32" ] ; then
+ PLATFORM_DIR=x86
+else
+ PLATFORM_DIR=x86_64
+fi
+
function copy {
- cd $HOME/grass$1
+ DIR=$1
+ VERSION=$2
+
+ cd ${HOME}/${PLATFORM_DIR}/grass${DIR}
- echo "Copying grass$1..."
+ echo "Copying grass${DIR}..."
- rm -rf $WWWDIR/grass$1
- mkdir $WWWDIR/grass$1
+ if [ ! -d ${WWWDIR}/${PLATFORM_DIR} ] ; then
+ mkdir ${WWWDIR}/${PLATFORM_DIR}
+ fi
+
+ DST_DIR=${WWWDIR}/${PLATFORM_DIR}/grass${DIR}
+
+ rm -rf $DST_DIR
+ mkdir $DST_DIR
- cp WinGRASS*.exe* $WWWDIR/grass$1
+ cp WinGRASS*.exe* $DST_DIR
- mkdir $WWWDIR/grass$1/osgeo4w
- cp grass*.tar.bz2 $WWWDIR/grass$1/osgeo4w
+ mkdir ${DST_DIR}/osgeo4w
+ cp grass*.tar.bz2 ${DST_DIR}/osgeo4w
- mkdir $WWWDIR/grass$1/logs
- cp -r log-r* $WWWDIR/grass$1/logs
+ mkdir ${DST_DIR}/logs
+ cp -r log-r* ${DST_DIR}/logs
- copy_addon $1 $2
+ copy_addon $DIR $VERSION
}
function copy_addon {
- version=$1
- version_full=$2
+ DIR=$1
+ VERSION=$2
+
+ cd ${HOME}/${PLATFORM_DIR}/grass${DIR}
- cd $HOME/grass$version
-
- echo "Copying AddOns for grass${version}..."
+ echo "Copying AddOns for grass${DIR}..."
- if test -n "$2"; then
- ADDONDIR=$WWWDIR/grass${version:0:2}/addons/grass-$version_full
+ if test -n "$VERSION"; then
+ ADDONDIR=${WWWDIR}/${PLATFORM_DIR}grass${DIR:0:2}/addons/grass-$VERSION
else
- ADDONDIR=$WWWDIR/grass${version:0:2}/addons
+ ADDONDIR=${WWWDIR}/${PLATFORM_DIR}grass${DIR:0:2}/addons
fi
mkdir -p $ADDONDIR
@@ -46,25 +72,22 @@
function create_zip {
echo "Creating zip..."
cd $WWWDIR
- rm wingrass.zip
- zip wingrass.zip grass64 grass70 grass71 -r -q
+ rm wingrass-$PLATFORM_DIR}.zip
+ zip wingrass-$PLATFORM_DIR}.zip ${PLATFORM_DIR} -r -q
}
-
-export PATH=$PATH:/c/OSGeo4W/apps/msys/bin:/c/OSGeo4W/bin
-
-if test -z $1 ; then
+if test -z $2 ; then
# daily builds
### copy 64 6.4.5svn
### copy 65
- copy 70 7.0.3svn
- copy 71 7.1.svn
- # releases
- copy_addon 644 6.4.4
- copy_addon 700 7.0.0
- copy_addon 701 7.0.1
- copy_addon 702 7.0.2
+ copy 70 7.0.3svn
+ copy 71 7.1.svn
+ # releases (TODO: enable later)
+ #copy_addon 644 6.4.4
+ #copy_addon 700 7.0.0
+ #copy_addon 701 7.0.1
+ #copy_addon 702 7.0.2
else
- copy $1 $2
+ copy $2 $3
fi
create_zip
Modified: grass-addons/tools/wingrass-packager/grass_md5sum.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_md5sum.sh 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_md5sum.sh 2015-12-13 14:05:27 UTC (rev 67096)
@@ -1,21 +1,37 @@
#!/bin/sh
# Create mdb5sum files for GRASS versions
+#
+# Options:
+# - platform (32 or 64)
+# - src postfix, eg. '70'
HOME=/c/Users/landa/grass_packager
+if test -z "$1"; then
+ echo "platform not specified"
+ exit 1
+fi
+PLATFORM=$1
+export PATH=/c/msys${PLATFORM}/usr/bin:/c/msys${PLATFORM}/mingw${PLATFORM}/bin:/c/osgeo4w${PLATFORM}/bin:${PATH}
+
function create_md5sum {
- cd $HOME/$1
+ GRASS_DIR=$1
+
+ if [ "$PLATFORM" = "32" ] ; then
+ PLATFORM_DIR=x86
+ else
+ PLATFORM_DIR=x86_64
+ fi
+
+ cd ${HOME}/${PLATFORM_DIR}/${GRASS_DIR}
for file in `ls WinGRASS*.exe`; do
md5sum $file > ${file}.md5sum
done
}
-export PATH=$PATH:/c/OSGeo4W/apps/msys/bin
-
-if test -z $1 ; then
+if test -z $2 ; then
# dev packages
### create_md5sum grass64
- ### create_md5sum grass65
create_md5sum grass70
create_md5sum grass71
else
Modified: grass-addons/tools/wingrass-packager/grass_osgeo4w.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_osgeo4w.sh 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_osgeo4w.sh 2015-12-13 14:05:27 UTC (rev 67096)
@@ -1,10 +1,34 @@
#!/bin/sh
# Copy GRASS OSGeo4W package
+#
+# Options:
+# - platform (32 or 64)
+# - pkg postfix, eg. '70'
+# - pkg version number
+# - pkg patch number
HOME=/c/Users/landa/grass_packager
+PATH_ORIG=`echo $PATH`
+if test -z "$1"; then
+ echo "platform not specified"
+ exit 1
+fi
+PLATFORM=$1
+export PATH=/c/msys${PLATFORM}/usr/bin:/c/msys${PLATFORM}/mingw${PLATFORM}/bin:/c/osgeo4w${PLATFORM}/bin:${PATH}
+
function rsync_package {
- dir=$HOME/grass$1/osgeo4w/package
+ POSTFIX=$1
+ VERSION=$2
+ PATCH=$3
+
+ if [ "$PLATFORM" = "32" ] ; then
+ PLATFORM_DIR=x86
+ else
+ PLATFORM_DIR=x86_64
+ fi
+
+ dir=${HOME}/${PLATFORM_DIR}/grass${POSTFIX}/osgeo4w/package
curr=`ls -t $dir/ 2>/dev/null | head -n1 | cut -d'-' -f4 | cut -d'.' -f1`
if [ $? -eq 0 ]; then
package=$curr
@@ -12,23 +36,22 @@
package=1
fi
- if test -z $2; then
- cp $dir/grass*-$package*.tar.bz2 $HOME/grass$1
+ if test -z $VERSION; then
+ # daily builds
+ cp $dir/grass*-$package*.tar.bz2 ${HOME}/${PLATFORM_DIR}/grass${POSTFIX}
else
- cp $dir/grass*-$package*.tar.bz2 $HOME/grass$1/grass-$2-$3.tar.bz2
+ # release
+ cp $dir/grass*-$package*.tar.bz2 ${HOME}/${PLATFORM_DIR}/grass${POSTFIX}/grass-${VERSION}-${PATCH}.tar.bz2
fi
}
-export PATH=$PATH:/c/OSGeo4W/apps/msys/bin
-
-if test -z $1 ; then
+if test -z $2 ; then
# dev packages
### rsync_package 64
- ### rsync_package 65
rsync_package 70
rsync_package 71
else
- rsync_package $1 $2 $3
+ rsync_package $2 $3 $4
fi
exit 0
Modified: grass-addons/tools/wingrass-packager/grass_packager.bat
===================================================================
--- grass-addons/tools/wingrass-packager/grass_packager.bat 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_packager.bat 2015-12-13 14:05:27 UTC (rev 67096)
@@ -3,68 +3,87 @@
cd C:\Users\landa\grass_packager
REM
-REM Clean-up
+echo Clean-up...
REM
-REM rmdir /s /q C:\OSGeo4W\apps\grass\grass-6.4.5svn
-REM rmdir /s /q C:\OSGeo4W\apps\grass\grass-6.5.svn
-rmdir /s /q C:\OSGeo4W\apps\grass\grass-7.0.3svn
-rmdir /s /q C:\OSGeo4W\apps\grass\grass-7.1.svn
+call :cleanUp x86
+call :cleanUp x86_64
REM
-REM Compile GRASS versions
+echo Compiling GRASS GIS...
REM
-C:\OSGeo4W\apps\msys\bin\bash.exe C:\Users\landa\grass_packager\grass_compile.sh
+C:\msys32\usr\bin\bash.exe .\grass_compile.sh 32
+C:\msys64\usr\bin\bash.exe .\grass_compile.sh 64
REM
-REM Clean-up
+echo Clean-up for packaging...
REM
-REM if exist .\grass64 rmdir /S/Q .\grass64
-REM xcopy C:\OSGeo4W\usr\src\grass64_release\mswindows\* .\grass64 /S/V/F/I
-REM if exist .\grass65 rmdir /S/Q .\grass65
-REM 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\grass70_release\mswindows\* .\grass70 /S/V/F/I
-if exist .\grass71 rmdir /S/Q .\grass71
-xcopy C:\OSGeo4W\usr\src\grass_trunk\mswindows\* .\grass71 /S/V/F/I
+REM call:cleanUpPkg x86
+REM call:cleanUpPkg x86_64
REM
echo Preparing packages...
REM
-REM cd .\grass64
-REM call .\GRASS-Packager.bat > .\GRASS-Packager.log
-REM cd ..
-REM cd .\grass65
-REM call .\GRASS-Packager.bat
-REM cd ..
-cd .\grass70
-call .\GRASS-Packager.bat > .\GRASS-Packager.log
-cd ..
-cd .\grass71
-call .\GRASS-Packager.bat > .\GRASS-Packager.log
-cd ..
+call:preparePkg x86 32
+call:preparePkg x86_64 64
-C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_osgeo4w.sh
-C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_svn_info.sh
+REM
+echo Finding latest package and update info...
+REM
+C:\msys32\usr\bin\bash.exe .\grass_osgeo4w.sh 32
+C:\msys64\usr\bin\bash.exe .\grass_osgeo4w.sh 64
+C:\msys32\usr\bin\bash.exe .\grass_svn_info.sh 32
+C:\msys64\usr\bin\bash.exe .\grass_svn_info.sh 64
REM
echo Creating standalone installer...
REM
-REM C:\DevTools\makensis.exe .\grass64\GRASS-Installer.nsi > .\grass64\GRASS-Installer.log
-REM C:\DevTools\makensis.exe .\grass65\GRASS-Installer.nsi
-C:\DevTools\makensis.exe .\grass70\GRASS-Installer.nsi > .\grass70\GRASS-Installer.log
-C:\DevTools\makensis.exe .\grass71\GRASS-Installer.nsi > .\grass71\GRASS-Installer.log
+call:createPkg x86
+call:createPkg x86_64
+pause
+
REM
REM Create md5sum files
REM
-C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_md5sum.sh
+C:\msys32\usr\bin\bash.exe .\grass_md5sum.sh 32
+C:\msys64\usr\bin\bash.exe .\grass_md5sum.sh 64
REM
REM Build Addons
REM
-C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_addons.sh
+C:\msys32\usr\bin\bash.exe .\grass_addons.sh 32
+C:\msys64\usr\bin\bash.exe .\grass_addons.sh 64
REM
REM Copy packages
REM
-C:\OSGeo4W\apps\msys\bin\sh.exe .\grass_copy_wwwroot.sh
+C:\msys32\usr\bin\bash.exe .\grass_copy_wwwroot.sh 32
+C:\msys64\usr\bin\bash.exe .\grass_copy_wwwroot.sh 64
+
+exit /b %ERRORLEVEL%
+
+:cleanUp
+for /d %%G in ("C:\OSGeo4W%~1\apps\grass\grass-7*svn") do rmdir /s /q "%%G"
+exit /b 0
+
+:cleanUpPkg
+ if not exist "%~1" mkdir %~1
+ if exist .\%~1\grass70 rmdir /S/Q .\%~1\grass70
+ xcopy C:\msys32\usr\src\grass70_release\mswindows\* .\%~1\grass70 /S/V/I > NUL
+ if exist .\%~1\grass71 rmdir /S/Q .\%~1\grass71
+ xcopy C:\msys32\usr\src\grass_trunk\mswindows\* .\%~1\grass71 /S/V/I > NUL
+exit /b 0
+
+:preparePkg
+ cd .\%~1\grass70
+ call .\GRASS-Packager.bat %~2 > .\GRASS-Packager.log
+ cd ..\..
+ cd .\%~1\grass71
+ call .\GRASS-Packager.bat %~2 > .\GRASS-Packager.log
+ cd ..\..
+exit /b 0
+
+:createPkg
+ C:\DevTools\makensis.exe .\%~1\grass70\GRASS-Installer.nsi > .\%~1\grass71\GRASS-Installer.log
+ C:\DevTools\makensis.exe .\%~1\grass71\GRASS-Installer.nsi > .\%~1\grass71\GRASS-Installer.log
+exit /b 0
Modified: grass-addons/tools/wingrass-packager/grass_svn_info.sh
===================================================================
--- grass-addons/tools/wingrass-packager/grass_svn_info.sh 2015-12-13 14:02:30 UTC (rev 67095)
+++ grass-addons/tools/wingrass-packager/grass_svn_info.sh 2015-12-13 14:05:27 UTC (rev 67096)
@@ -1,28 +1,47 @@
#!/bin/sh
# Update SVN version info
+#
+# Options:
+# - platform (32 or 64)
+# - src postfix, eg. '_trunk'
+# - pkg patch number
-SRC=/usr/src
+SRC=usr/src
PACKAGEDIR=mswindows/osgeo4w/package
HOME=/c/Users/landa/grass_packager
+if test -z "$1"; then
+ echo "platform not specified"
+ exit 1
+fi
+PLATFORM=$1
+
+export PATH=/c/msys${PLATFORM}/usr/bin:/c/msys${PLATFORM}/mingw${PLATFORM}/bin:/c/osgeo4w${PLATFORM}/bin:${PATH}
+
+if [ "$PLATFORM" = "32" ] ; then
+ PLATFORM_DIR=x86
+else
+ PLATFORM_DIR=x86_64
+fi
+
function update {
- if [ "$1" = "grass_trunk" ] ; then
- SRC_PATH=/c/osgeo4w/$SRC/$1
- else
- SRC_PATH=/c/osgeo4w/$SRC/$1
- fi
- DEST_PATH=$HOME/$2
+ GRASS_DIR=$1
+ DST_DIR=$2
+ PATCH_NUM=$3
+
+ SRC_PATH=/c/msys${PLATFORM}/$SRC/$GRASS_DIR
+ DEST_PATH=${HOME}/${PLATFORM_DIR}/${DST_DIR}
cd $SRC_PATH
REV=`svn info | grep 'Last Changed Rev:' | cut -d':' -f2 | tr -d ' '`
- if test -z $3 ; then
+ if test -z $PATCH_NUM ; 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=$PATCH_NUM
fi
exec 3<include/VERSION
@@ -46,7 +65,11 @@
}
function create_log {
- cd $HOME/grass$1
+ VERSION=$1
+ REV=$2
+ PATCH=$3
+
+ cd ${HOME}/${PLATFORM_DIR}/grass${VERSION}
LOG_DIR=log-r$2-$3
mkdir -p $LOG_DIR
@@ -54,19 +77,13 @@
cp error.log $LOG_DIR/
}
-export PATH=$PATH:/c/OSGeo4W/apps/msys/bin:/c/subversion/bin/svn
-
-VERSION=$1
-NUM=$2
-
-if test -z $VERSION ; then
+if test -z $2 ; then
# dev packages
### update grass64_release grass64
- ### update grass6_devel grass65
update grass70_release grass70
update grass_trunk grass71
else
- update grass$VERSION grass$VERSION $NUM
+ update grass$2 grass$2 $3
fi
exit 0
More information about the grass-commit
mailing list