File: gdalnightlysvn.sh

package info (click to toggle)
gdal 1.10.1+dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,320 kB
  • ctags: 74,726
  • sloc: cpp: 677,199; ansic: 162,820; python: 13,816; cs: 11,163; sh: 10,446; java: 5,279; perl: 4,429; php: 2,971; xml: 1,500; yacc: 934; makefile: 494; sql: 112
file content (87 lines) | stat: -rw-r--r-- 1,756 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
#
# $Id$
#
# Script generates GDAL nightly snapshot packages.
#
###### CONFIGURATION BEGIN ######
VERBOSE=1
VERSION_STABLE="1.8"
# Make sure we get the right swig. 
PATH=/usr/local/swig-1.3.39/bin:$PATH
###### CONFIGURATION END ######

if [ $# != 1 ] ; then
    echo "Missing SVN branch!"
    echo "Available branches: trunk, stable"
    exit 1
fi

if [ $# -eq 1 ] ; then
  BRANCH=$1
  if test ! "${BRANCH}" = "trunk" -a ! "${BRANCH}" = "stable"; then
    echo "Unknown branch passed!"
    echo "Available branches: trunk, stable"
    exit 1
  fi
fi

if test ${VERBOSE} = 1; then
	echo "Selecting GDAL branch: ${BRANCH}"
fi

GDAL="gdal"
SVNBRANCH="trunk"
if test "${BRANCH}" = "stable"; then
  GDAL="gdal-${VERSION_STABLE}"
  SVNBRANCH="branches/${VERSION_STABLE}"
fi

CWD=/osgeo/gdal
DATE=`date +%Y%m%d`
DATEVER=`date +%Y.%m.%d`
NIGHTLYVER="svn-${BRANCH}-${DATEVER}"
BUILDER="/osgeo/gdal/mkgdaldist.sh"
GDALDIR="${CWD}/${GDAL}"
DAILYDIR="/osgeo/gdal/gdal-web/daily"
LOG="/dev/null"

if test ${VERBOSE} = 1; then
	LOG=/osgeo/gdal/nightly.log
	echo -n "Building GDAL Nightly: ${NIGHTLYVER}..."
fi

if test ! -d ${GDALDIR}; then
	mkdir ${GDALDIR}
fi

cd ${GDALDIR}
${BUILDER} ${NIGHTLYVER} -date ${DATE} -branch ${SVNBRANCH} >& ${LOG}
if test  $? -gt 0; then
	echo
	echo "Command ${BUILDER} failed. Check ${LOG} file for details."
	cd ${CWD}
	exit 1
fi

cd ${CWD}

if test ${VERBOSE} = 1; then
	echo "Done"
fi

if test ${VERBOSE} = 1; then
	echo -n "Uploading ${NIGHTLYVER} to daily download..."
fi

find ${DAILYDIR} -name '*'${BRANCH}'*'
if test $? -eq 0 ; then
	find ${DAILYDIR} -name '*'${BRANCH}'*' | xargs rm -f
fi
mv ${GDALDIR}/*${NIGHTLYVER}* ${DAILYDIR}
mv ${GDALDIR}/gdalsvn*.zip ${DAILYDIR}

if test ${VERBOSE} = 1; then
	echo "Done"
fi