]> git.pld-linux.org Git - packages/closure-compiler.git/blob - get-source.sh
9/11
[packages/closure-compiler.git] / get-source.sh
1 #!/bin/sh
2 p=closure-compiler
3 fn=compiler
4 svn=http://$p.googlecode.com/svn/trunk
5 dl=https://code.google.com/p/$p/downloads/list?can=3
6
7 set -x
8 set -e
9
10 html() {
11         if [ -z "$html" ]; then
12                 html=$(lynx -width 1200 -dump -nolist "$dl")
13         fi
14         echo "$html" | tee debug.log
15 }
16
17 rev=$(html | perl -ne '/'$fn'-.+tar.*Buil[dt] at r?(\d+)/and print $1 and exit')
18 test -n "$rev"
19
20 date=$(html | perl -ne '/'$fn'-(\d+).tar.gz.*Buil[dt] at r?'$rev'/and print $1')
21 test -n "$date"
22
23 d=$p-$date
24 if [ ! -d "$d" ]; then
25         svn export -q $svn@$rev $p-$date
26 fi
27
28 t=$d.tar.bz2
29 if [ ! -f "$t" ]; then
30         tar -cjf $t --exclude-vcs $d
31 fi
This page took 0.030189 seconds and 3 git commands to generate.