-
Notifications
You must be signed in to change notification settings - Fork 1
/
grass_osgeo4w.sh
53 lines (43 loc) · 1.05 KB
/
grass_osgeo4w.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# Copy GRASS OSGeo4W package
#
# Options:
# - pkg postfix, eg. '70'
# - pkg version number
# - pkg patch number
PATH_ORIG=`echo $PATH`
export PATH=/c/msys64/usr/bin:/c/msys64/mingw64/bin:/c/osgeo4w/bin:${PATH}
function rsync_package {
POSTFIX=$1
VERSION=$2
PATCH=$3
dir=${HOME}/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
else
package=1
fi
if test -z $VERSION; then
# daily builds
cp $dir/grass*-$package*.tar.bz2 ${HOME}/grass${POSTFIX}
else
# release
cp $dir/grass*-$package*.tar.bz2 ${HOME}/grass${POSTFIX}/grass-${VERSION}-${PATCH}.tar.bz2
fi
src_package $POSTFIX $VERSION $PATCH
}
function src_package {
POSTFIX=$1
VERSION=$2
PATCH=$3
tar cvjf grass-${VERSION}-${PATCH}-src.tar.bz2 -C ${HOME}/grass${POSTFIX}/osgeo4w package.sh
}
if test -z $1 ; then
while read version; do
rsync_package $version
done < dev_packages.csv
else
rsync_package $1 $2 $3
fi
exit 0