]> git.ipfire.org Git - thirdparty/squid.git/blame - mksnapshot-cron.sh
Typo in UdpOpenDialer
[thirdparty/squid.git] / mksnapshot-cron.sh
CommitLineData
d128f8ab 1#!/bin/sh -e
9c1550be 2echo "RUN: $0"
16760e84 3# Nightly cron job to generate snapshot releases
c79c8240 4top=${PWD}
3e16d6e1 5versions=/server/httpd/htdocs/squid-cache.org/content/Versions/
c79c8240 6TMPDIR=/home/squidadm/${LOGNAME}.cron
16760e84 7export TMPDIR
c79c8240
AJ
8if [ -d ${TMPDIR} ]; then
9 chmod -R +w ${TMPDIR}
10 rm -rf ${TMPDIR}
16760e84 11fi
c79c8240 12mkdir -p ${TMPDIR}
9c1550be 13trap "echo FAIL-BUILD_snapshot-cron; cd /; chmod -R +w ${TMPDIR}; rm -rf ${TMPDIR}" 0
16760e84 14
73bf367e 15PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
16760e84 16export PATH
17
18# Be nice to our friends. This is a batch job
19renice 10 $$ >/dev/null
20
21make_snapshot()
22{ {
23 set -e
24 cd ../release
c79c8240
AJ
25 mksnap=${1}
26 branch=${2}
27 dir=${3}
28 ver=${4}
16760e84 29 save=${5:-3}
c79c8240 30 dst=${versions}/${dir}/${ver}
eff68534 31 out=${6:-`basename $branch`}
c79c8240
AJ
32 $mksnap ${branch} ${6} 2>&1 | grep -v "set owner/group"
33 for file in `cat ${out}.out` ; do
34 case ${file} in
28a28b8e 35 *-cfgman.tar.gz)
36 type=-cfgman.tar.gz
37 ;;
b3b99536
AJ
38 *-langpack.tar.gz)
39 type=-langpack.tar.gz
40 ;;
12175206
AJ
41 *-manuals.tar.gz)
42 type=-manuals.tar.gz
43 ;;
28a28b8e 44 *)
c79c8240 45 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/'`
28a28b8e 46 esac
16760e84 47
48 # move tarball
c79c8240
AJ
49 rm -f ${dst}/${file}.md5
50 rm -f ${dst}/${file}
51 md5 ${file} >${dst}/${file}.md5
52 cp -p ${file} ${dst}/${file}
53 rm -f ${file}
16760e84 54
55 # update snapshot symlink
c79c8240
AJ
56 rm -f ${dst}/squid-${ver}.snapshot$type
57 ln -s ${file} ${dst}/squid-${ver}.snapshot${type}
58 rm -f ${dst}/squid-${ver}.snapshot${type}.md5
59 ln -s ${file}.md5 ${dst}/squid-${ver}.snapshot${type}.md5
16760e84 60
61 # cleanup old snapshots
ed9c16d2
AJ
62 ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r*[0-9]${type} | \
63 sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r[0-9]+'${type}'\)/\1/' | \
64 sort -r | tail +${save} | \
65 while read f; do
c79c8240 66 rm -f ${dst}/*-${f} ${dst}/*-${f}.md5
b8801977 67 done
4b475dd4 68
3cdf47ea
AJ
69 # update dynamic index pages Last-Modified info
70 touch ${dst}/index.dyn
71
4b475dd4 72 # Special cases
c79c8240 73 case ${file} in
4b475dd4 74 *-cfgman.tar.gz)
c79c8240
AJ
75 mkdir -p ${dst}/cfgman
76 tar -C ${dst}/cfgman -zxf ${dst}/${file}
4b475dd4 77 ;;
47eac8b8 78 *-cfgman.html)
c79c8240
AJ
79 rm -f ${dst}/cfgman.html
80 ln -s ${dst}/${file} ${dst}/cfgman.html
47eac8b8 81 ;;
82 *-cfgman.html.gz)
c79c8240
AJ
83 rm -f ${dst}/cfgman.html.gz
84 ln -s ${dst}/${file} ${dst}/cfgman.html.gz
47eac8b8 85 ;;
12175206 86 *-manuals.tar.gz)
c79c8240
AJ
87 mkdir -p ${dst}/manuals
88 tar -C ${dst}/manuals -zxf ${dst}/${file}
12175206 89 ;;
4b475dd4 90 esac
16760e84 91 done
16760e84 92} }
93
94set +e
95
7a4766c6
HN
96# autotool derived files not kept in trunk, but still need to bootstrap for make dist
97../commit/bootstrap squid-3
3e16d6e1 98make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6
16760e84 99
2accec88 100rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
720e7b9c 101cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
2accec88 102chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
3e16d6e1 103mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/content/CONTRIBUTORS.txt
2accec88 104
105rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new
720e7b9c 106cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new
2accec88 107chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new
3e16d6e1 108mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt
7ecf1a1c 109
ddaf63b1 110../commit/bootstrap squid-3.2
ed9c16d2 111make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 30
ddaf63b1 112
037ade45 113../commit/bootstrap squid-3.1
ed9c16d2 114make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 30
037ade45 115
97f546d1
AJ
116#../commit/bootstrap squid-3.0
117#make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3
16760e84 118
029ef05a
AJ
119#../commit/bootstrap squid-2
120#make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3
33835f37 121
029ef05a
AJ
122#../commit/bootstrap squid-2.7
123#make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3
f1a01511 124
0e8cd610
HN
125#../commit/bootstrap squid-2.6
126#make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3
16760e84 127
031dffde 128#../commit/bootstrap squid-2.5
129#make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3
16760e84 130
131#../commit/squid3-SQUID2.sync