]> git.ipfire.org Git - thirdparty/squid.git/blob - mksnapshot-cron.sh
Merged from trunk
[thirdparty/squid.git] / mksnapshot-cron.sh
1 #!/bin/sh -e
2 # Nightly cron job to generate snapshot releases
3 top=$PWD
4 versions=/server/httpd/htdocs/squid-cache.org/Versions/
5 TMPDIR=/tmp/hno.cron
6 export TMPDIR
7 if [ -d $TMPDIR ]; then
8 chmod -R +w $TMPDIR
9 rm -rf $TMPDIR
10 fi
11 mkdir -p $TMPDIR
12 trap "cd /; chmod -R +w $TMPDIR; rm -rf $TMPDIR" 0
13
14 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
15 export PATH
16
17 # Be nice to our friends. This is a batch job
18 renice 10 $$ >/dev/null
19
20 make_snapshot()
21 { {
22 set -e
23 cd ../release
24 mksnap=$1
25 branch=$2
26 dir=$3
27 ver=$4
28 save=${5:-3}
29 dst=$versions/$dir/$ver
30 out=${6:-`basename $branch`}
31 $mksnap $branch $6 2>&1 | grep -v "set owner/group"
32 for file in `cat $out.out` ; do
33 case $file in
34 *-cfgman.tar.gz)
35 type=-cfgman.tar.gz
36 ;;
37 *-langpack.tar.gz)
38 type=-langpack.tar.gz
39 ;;
40 *)
41 type=`echo $file | sed -e 's/.*\.tar\.gz/.tar.gz/' -e 's/.*\.tar\.bz2/.tar.bz2/' -e 's/.*\.patch/.patch/' -e 's/.*\.diff/.diff/' -e 's/.*-RELEASENOTES.html/-RELEASENOTES.html/' -e 's/^.*ChangeLog.txt$/-ChangeLog.txt/' -e 's/.*-cfgman/-cfgman/'`
42 esac
43
44 # move tarball
45 rm -f $dst/$file.md5
46 rm -f $dst/$file
47 md5 $file >$dst/$file.md5
48 cp -p $file $dst/$file
49 rm -f $file
50
51 # update snapshot symlink
52 rm -f $dst/squid-$ver.snapshot$type
53 ln -s $file $dst/squid-$ver.snapshot$type
54 rm -f $dst/squid-$ver.snapshot$type.md5
55 ln -s $file.md5 $dst/squid-$ver.snapshot$type.md5
56
57 # cleanup old snapshots
58 ls $dst/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$type | sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'$type'\)/\1/' | sort -r | tail +$save | while read f; do
59 rm -f $dst/*-$f $dst/*-$f.md5
60 done
61
62 # Special cases
63 case $file in
64 *-cfgman.tar.gz)
65 mkdir -p $dst/cfgman
66 tar -C $dst/cfgman -zxf $dst/$file
67 ;;
68 *-cfgman.html)
69 rm -f $dst/cfgman.html
70 ln -s $dst/$file $dst/cfgman.html
71 ;;
72 *-cfgman.html.gz)
73 rm -f $dst/cfgman.html.gz
74 ln -s $dst/$file $dst/cfgman.html.gz
75 ;;
76 esac
77 done
78
79 # update web page
80 if [ -x $dst/make.sh ]; then
81 $dst/make.sh
82 fi
83
84 } }
85
86 set +e
87
88 # autotool derived files not kept in trunk, but still need to bootstrap for make dist
89 ../commit/bootstrap squid-3
90 make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 HEAD 6
91
92 rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
93 cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
94 chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
95 mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.txt
96
97 rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new
98 cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new
99 chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new
100 mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/SPONSORS.txt
101
102 ../commit/bootstrap squid-3.0
103 make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3
104
105 ../commit/bootstrap squid-2
106 make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3
107
108 ../commit/bootstrap squid-2.7
109 make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3
110
111 #../commit/bootstrap squid-2.6
112 #make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3
113
114 #../commit/bootstrap squid-2.5
115 #make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3
116
117 #../commit/squid3-SQUID2.sync