Debian Codegraph @

scripts/download/mksnapbranches

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 PROGDIR=$(dirnamescip-shell system . . dirname. $(readlinkscip-shell system . . readlink. -f $0))
4
5 export JAVA_HOME=/opt/javascip-shell filesystem . . `/opt/java`.
6 export PATH="$JAVA_HOME/bin:$VIRTUAL_ENV/bin:/bin:/usr/bin:/usr/local/bin:$PROGDIR"
7 export LANG=en_GB.UTF-8
8
9 typeset -i VERSION
10 typeset -i MIN_VERSION
11
12 while getopts "d:" c
13 do
14 case $c in
15 d) SNAPDIR=$OPTARG;;
16 esac
17 done
18 shift $[OPTIND-1]
19
20 PRODUCT=$1
21 if [scip-shell system . . `[`. "$PRODUCT" = "" ]; then
22 echoscip-shell system . . echo. Usage: "mksnapbranches [-d dir] [-r vers] <product>"
23 exit
24 fi
25
26 source mksnapfuncsscip-shell source . . mksnapfuncs.
27
28 export LANG=en_GB.UTF-8
29
30 SVN=http://svn.mkgmap.org.uk/$PRODUCT
31 SNAPDIR=${SNAPDIR:-$HOME/www/mkgmap.org.uk/docroot/download}
32
33 # Get the commit time of the given path
34 svn_get_timescip-shell shell shell-project 0.0.0 svn_get_time().() {
35 typeset time
36 time=$(svn log --xml --limit 1 $SVN/$1 2> /dev/nullscip-shell filesystem . . `/dev/null`. | sedscip-shell system . . sed. \
37 -n -e 's/<date>\(.*\)<\/date>/\1/;s/T/ /;s/Z/+0000/p'
38 )
39 datescip-shell system . . date. -d"$time" +%s
40 }
41
42 # We ignore all branches older than 90 days
43 MIN_TIME=$(svn_get_timescip-shell shell shell-project 0.0.0 svn_get_time(). trunk)
44 ((MIN_TIME=MIN_TIME - 3600*24*90))
45
46 BRANCHES=$(svn ls $SVN/branches)
47 for branch in $BRANCHES
48 do
49 BRANCH=${branch%/}
50 BRANCH_TIME=$(svn_get_timescip-shell shell shell-project 0.0.0 svn_get_time(). branches/$BRANCH)
51
52 if [scip-shell system . . `[`. $BRANCH_TIME -lt $MIN_TIME ]; then
53 echoscip-shell system . . echo. Too old ignoring $BRANCH
54 continue
55 fi
56
57 echoscip-shell system . . echo. Building $BRANCH
58 redis-cli lpush svn:build build:$PRODUCT:$BRANCH:
59 done