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