]> git.ipfire.org Git - thirdparty/squid.git/blame - mksnapshot-cron.sh
Bootstrapped
[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/
5TMPDIR=/tmp/hno.cron
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
25 tag=$2
26 dir=$3
27 ver=$4
28 save=${5:-3}
29 dst=$versions/$dir/$ver
30 $mksnap $tag 2>&1 | grep -v "set owner/group"
31 for file in `cat $tag.out` ; do
32 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/'`
33
34 # move tarball
ba10ae8e 35 rm -f $dst/$file.md5
16760e84 36 rm -f $dst/$file
ba10ae8e 37 md5 $file >$dst/$file.md5
16760e84 38 cp -p $file $dst/$file
39 rm -f $file
40
41 # update snapshot symlink
42 rm -f $dst/squid-$ver.snapshot$type
43 ln -s $file $dst/squid-$ver.snapshot$type
ba10ae8e 44 rm -f $dst/squid-$ver.snapshot$type.md5
45 ln -s $file $dst/squid-$ver.snapshot$type.md5
16760e84 46
47 # cleanup old snapshots
e45df184 48 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 49 rm -f $dst/*-$f $dst/*-$f.md5
b8801977 50 done
16760e84 51 done
52
53 # update web page
54 if [ -x $dst/make.sh ]; then
55 $dst/make.sh
56 fi
57
58} }
59
60set +e
61
62../commit/bootstrap squid
912feb28 63#make_snapshot ../commit/squid/mksnapshot.sh HEAD v3 HEAD 6
16760e84 64
2accec88 65rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
66cp ../commit/squid/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
67chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
68mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.txt
69
70rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new
71cp ../commit/squid/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new
72chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new
73mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/SPONSORS.txt
7ecf1a1c 74
16760e84 75#../commit/bootstrap squid-3.0
76#make_snapshot ../commit/squid/mksnapshot.sh SQUID_3_0 v3 3.0 3
77make_snapshot ../commit/squid/mksnapshot.sh HEAD v3 3.0 3
78
74946300 79../commit/bootstrap squid-2
33835f37 80make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3
81
82../commit/bootstrap squid-2.6
f5562997 83make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3
16760e84 84
031dffde 85#../commit/bootstrap squid-2.5
86#make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3
16760e84 87
88#../commit/squid3-SQUID2.sync