]> git.ipfire.org Git - thirdparty/squid.git/blame - mksnapshot-cron.sh
Bug 3463: dnsserver fails to compile
[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
74243da8 61 set +e
16760e84 62 # cleanup old snapshots
ed9c16d2
AJ
63 ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r*[0-9]${type} | \
64 sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r[0-9]+'${type}'\)/\1/' | \
65 sort -r | tail +${save} | \
66 while read f; do
c79c8240 67 rm -f ${dst}/*-${f} ${dst}/*-${f}.md5
b8801977 68 done
4b475dd4 69
74243da8
A
70 set -e
71
3cdf47ea
AJ
72 # update dynamic index pages Last-Modified info
73 touch ${dst}/index.dyn
74
4b475dd4 75 # Special cases
c79c8240 76 case ${file} in
4b475dd4 77 *-cfgman.tar.gz)
c79c8240
AJ
78 mkdir -p ${dst}/cfgman
79 tar -C ${dst}/cfgman -zxf ${dst}/${file}
4b475dd4 80 ;;
47eac8b8 81 *-cfgman.html)
c79c8240
AJ
82 rm -f ${dst}/cfgman.html
83 ln -s ${dst}/${file} ${dst}/cfgman.html
47eac8b8 84 ;;
85 *-cfgman.html.gz)
c79c8240
AJ
86 rm -f ${dst}/cfgman.html.gz
87 ln -s ${dst}/${file} ${dst}/cfgman.html.gz
47eac8b8 88 ;;
12175206 89 *-manuals.tar.gz)
c79c8240
AJ
90 mkdir -p ${dst}/manuals
91 tar -C ${dst}/manuals -zxf ${dst}/${file}
12175206 92 ;;
4b475dd4 93 esac
16760e84 94 done
16760e84 95} }
96
97set +e
98
7a4766c6
HN
99# autotool derived files not kept in trunk, but still need to bootstrap for make dist
100../commit/bootstrap squid-3
3e16d6e1 101make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6
16760e84 102
2accec88 103rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
720e7b9c 104cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
2accec88 105chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
3e16d6e1 106mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/content/CONTRIBUTORS.txt
2accec88 107
108rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new
720e7b9c 109cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new
2accec88 110chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new
3e16d6e1 111mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt
7ecf1a1c 112
ddaf63b1 113../commit/bootstrap squid-3.2
ed9c16d2 114make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 30
ddaf63b1 115
037ade45 116../commit/bootstrap squid-3.1
ed9c16d2 117make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 30
037ade45 118
97f546d1
AJ
119#../commit/bootstrap squid-3.0
120#make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3
16760e84 121
029ef05a
AJ
122#../commit/bootstrap squid-2
123#make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3
33835f37 124
029ef05a
AJ
125#../commit/bootstrap squid-2.7
126#make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3
f1a01511 127
0e8cd610
HN
128#../commit/bootstrap squid-2.6
129#make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3
16760e84 130
031dffde 131#../commit/bootstrap squid-2.5
132#make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3
16760e84 133
134#../commit/squid3-SQUID2.sync