]>
Commit | Line | Data |
---|---|---|
16760e84 | 1 | #!/bin/sh -e |
2 | # Nightly cron job to generate snapshot releases | |
16760e84 | 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=/bin:/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 | 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 | |
35 | rm -f $dst/$file | |
36 | cp -p $file $dst/$file | |
37 | rm -f $file | |
38 | ||
39 | # update snapshot symlink | |
40 | rm -f $dst/squid-$ver.snapshot$type | |
41 | ln -s $file $dst/squid-$ver.snapshot$type | |
42 | ||
43 | # cleanup old snapshots | |
e45df184 | 44 | 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 |
9cc5c728 | 45 | rm -f $dst/*-$f |
b8801977 | 46 | done |
16760e84 | 47 | done |
48 | ||
49 | # update web page | |
50 | if [ -x $dst/make.sh ]; then | |
51 | $dst/make.sh | |
52 | fi | |
53 | ||
54 | } } | |
55 | ||
56 | set +e | |
57 | ||
58 | ../commit/bootstrap squid | |
912feb28 | 59 | #make_snapshot ../commit/squid/mksnapshot.sh HEAD v3 HEAD 6 |
16760e84 | 60 | |
2accec88 | 61 | rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
62 | cp ../commit/squid/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new | |
63 | chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new | |
64 | mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.txt | |
65 | ||
66 | rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
67 | cp ../commit/squid/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
68 | chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
69 | mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/SPONSORS.txt | |
7ecf1a1c | 70 | |
16760e84 | 71 | #../commit/bootstrap squid-3.0 |
72 | #make_snapshot ../commit/squid/mksnapshot.sh SQUID_3_0 v3 3.0 3 | |
73 | make_snapshot ../commit/squid/mksnapshot.sh HEAD v3 3.0 3 | |
74 | ||
74946300 | 75 | ../commit/bootstrap squid-2 |
4fb7fd02 | 76 | make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 2.6 3 |
16760e84 | 77 | |
031dffde | 78 | #../commit/bootstrap squid-2.5 |
79 | #make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3 | |
16760e84 | 80 | |
81 | #../commit/squid3-SQUID2.sync |