]>
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 | ||
73bf367e | 14 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin |
16760e84 | 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 | |
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 | ;; | |
37 | *) | |
38 | 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/'` | |
39 | esac | |
16760e84 | 40 | |
41 | # move tarball | |
ba10ae8e | 42 | rm -f $dst/$file.md5 |
16760e84 | 43 | rm -f $dst/$file |
ba10ae8e | 44 | md5 $file >$dst/$file.md5 |
16760e84 | 45 | cp -p $file $dst/$file |
46 | rm -f $file | |
47 | ||
48 | # update snapshot symlink | |
49 | rm -f $dst/squid-$ver.snapshot$type | |
50 | ln -s $file $dst/squid-$ver.snapshot$type | |
ba10ae8e | 51 | rm -f $dst/squid-$ver.snapshot$type.md5 |
52 | ln -s $file $dst/squid-$ver.snapshot$type.md5 | |
16760e84 | 53 | |
54 | # cleanup old snapshots | |
e45df184 | 55 | 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 | 56 | rm -f $dst/*-$f $dst/*-$f.md5 |
b8801977 | 57 | done |
4b475dd4 | 58 | |
59 | # Special cases | |
60 | case $file in | |
61 | *-cfgman.tar.gz) | |
62 | mkdir -p $dst/cfgman | |
63 | tar -C $dst/cfgman -zxf $dst/$file | |
64 | ;; | |
47eac8b8 | 65 | *-cfgman.html) |
e99c0d7e | 66 | rm -f $dst/cfgman.html |
67 | ln -s $dst/$file $dst/cfgman.html | |
47eac8b8 | 68 | ;; |
69 | *-cfgman.html.gz) | |
e99c0d7e | 70 | rm -f $dst/cfgman.html.gz |
71 | ln -s $dst/$file $dst/cfgman.html.gz | |
47eac8b8 | 72 | ;; |
4b475dd4 | 73 | esac |
16760e84 | 74 | done |
75 | ||
76 | # update web page | |
77 | if [ -x $dst/make.sh ]; then | |
78 | $dst/make.sh | |
79 | fi | |
80 | ||
81 | } } | |
82 | ||
83 | set +e | |
84 | ||
7a4766c6 HN |
85 | # autotool derived files not kept in trunk, but still need to bootstrap for make dist |
86 | ../commit/bootstrap squid-3 | |
f3aaab79 | 87 | make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 HEAD 6 |
16760e84 | 88 | |
2accec88 | 89 | rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
720e7b9c | 90 | cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
2accec88 | 91 | chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
92 | mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.txt | |
93 | ||
94 | rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
720e7b9c | 95 | cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new |
2accec88 | 96 | chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new |
97 | mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/SPONSORS.txt | |
7ecf1a1c | 98 | |
0fac78f1 | 99 | ../commit/bootstrap squid-3.0 |
64871e75 | 100 | make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3 |
16760e84 | 101 | |
74946300 | 102 | ../commit/bootstrap squid-2 |
33835f37 | 103 | make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3 |
104 | ||
f1a01511 | 105 | ../commit/bootstrap squid-2.7 |
106 | make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3 | |
107 | ||
0e8cd610 HN |
108 | #../commit/bootstrap squid-2.6 |
109 | #make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3 | |
16760e84 | 110 | |
031dffde | 111 | #../commit/bootstrap squid-2.5 |
112 | #make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3 | |
16760e84 | 113 | |
114 | #../commit/squid3-SQUID2.sync |