]>
Commit | Line | Data |
---|---|---|
d128f8ab | 1 | #!/bin/sh -e |
a151895d | 2 | # |
b8ae064d | 3 | ## Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
a151895d AJ |
4 | ## |
5 | ## Squid software is distributed under GPLv2+ license and includes | |
6 | ## contributions from numerous individuals and organizations. | |
7 | ## Please see the COPYING and CONTRIBUTORS files for details. | |
8 | ## | |
9 | ||
9c1550be | 10 | echo "RUN: $0" |
16760e84 | 11 | # Nightly cron job to generate snapshot releases |
c79c8240 | 12 | top=${PWD} |
3e16d6e1 | 13 | versions=/server/httpd/htdocs/squid-cache.org/content/Versions/ |
c79c8240 | 14 | TMPDIR=/home/squidadm/${LOGNAME}.cron |
16760e84 | 15 | export TMPDIR |
c79c8240 AJ |
16 | if [ -d ${TMPDIR} ]; then |
17 | chmod -R +w ${TMPDIR} | |
18 | rm -rf ${TMPDIR} | |
16760e84 | 19 | fi |
c79c8240 | 20 | mkdir -p ${TMPDIR} |
9c1550be | 21 | trap "echo FAIL-BUILD_snapshot-cron; cd /; chmod -R +w ${TMPDIR}; rm -rf ${TMPDIR}" 0 |
16760e84 | 22 | |
73bf367e | 23 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin |
16760e84 | 24 | export PATH |
25 | ||
26 | # Be nice to our friends. This is a batch job | |
27 | renice 10 $$ >/dev/null | |
28 | ||
29 | make_snapshot() | |
30 | { { | |
31 | set -e | |
32 | cd ../release | |
c79c8240 AJ |
33 | mksnap=${1} |
34 | branch=${2} | |
35 | dir=${3} | |
36 | ver=${4} | |
16760e84 | 37 | save=${5:-3} |
c79c8240 | 38 | dst=${versions}/${dir}/${ver} |
eff68534 | 39 | out=${6:-`basename $branch`} |
c79c8240 AJ |
40 | $mksnap ${branch} ${6} 2>&1 | grep -v "set owner/group" |
41 | for file in `cat ${out}.out` ; do | |
42 | case ${file} in | |
28a28b8e | 43 | *-cfgman.tar.gz) |
44 | type=-cfgman.tar.gz | |
45 | ;; | |
b3b99536 AJ |
46 | *-langpack.tar.gz) |
47 | type=-langpack.tar.gz | |
48 | ;; | |
12175206 AJ |
49 | *-manuals.tar.gz) |
50 | type=-manuals.tar.gz | |
51 | ;; | |
28a28b8e | 52 | *) |
c79c8240 | 53 | 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 | 54 | esac |
16760e84 | 55 | |
56 | # move tarball | |
c79c8240 AJ |
57 | rm -f ${dst}/${file}.md5 |
58 | rm -f ${dst}/${file} | |
59 | md5 ${file} >${dst}/${file}.md5 | |
60 | cp -p ${file} ${dst}/${file} | |
61 | rm -f ${file} | |
16760e84 | 62 | |
63 | # update snapshot symlink | |
c79c8240 AJ |
64 | rm -f ${dst}/squid-${ver}.snapshot$type |
65 | ln -s ${file} ${dst}/squid-${ver}.snapshot${type} | |
66 | rm -f ${dst}/squid-${ver}.snapshot${type}.md5 | |
67 | ln -s ${file}.md5 ${dst}/squid-${ver}.snapshot${type}.md5 | |
16760e84 | 68 | |
74243da8 | 69 | set +e |
16760e84 | 70 | # cleanup old snapshots |
ed9c16d2 | 71 | ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r*[0-9]${type} | \ |
5f3f8b3f | 72 | # sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r[0-9]+'${type}'\)/\1/' | \ |
ed9c16d2 AJ |
73 | sort -r | tail +${save} | \ |
74 | while read f; do | |
5f3f8b3f | 75 | rm -f ${f} ${f}.md5 |
b8801977 | 76 | done |
74243da8 A |
77 | set -e |
78 | ||
3cdf47ea AJ |
79 | # update dynamic index pages Last-Modified info |
80 | touch ${dst}/index.dyn | |
81 | ||
4b475dd4 | 82 | # Special cases |
c79c8240 | 83 | case ${file} in |
4b475dd4 | 84 | *-cfgman.tar.gz) |
c79c8240 AJ |
85 | mkdir -p ${dst}/cfgman |
86 | tar -C ${dst}/cfgman -zxf ${dst}/${file} | |
4b475dd4 | 87 | ;; |
47eac8b8 | 88 | *-cfgman.html) |
c79c8240 AJ |
89 | rm -f ${dst}/cfgman.html |
90 | ln -s ${dst}/${file} ${dst}/cfgman.html | |
47eac8b8 | 91 | ;; |
92 | *-cfgman.html.gz) | |
c79c8240 AJ |
93 | rm -f ${dst}/cfgman.html.gz |
94 | ln -s ${dst}/${file} ${dst}/cfgman.html.gz | |
47eac8b8 | 95 | ;; |
12175206 | 96 | *-manuals.tar.gz) |
c79c8240 AJ |
97 | mkdir -p ${dst}/manuals |
98 | tar -C ${dst}/manuals -zxf ${dst}/${file} | |
12175206 | 99 | ;; |
4b475dd4 | 100 | esac |
16760e84 | 101 | done |
16760e84 | 102 | } } |
103 | ||
104 | set +e | |
105 | ||
7a4766c6 | 106 | # autotool derived files not kept in trunk, but still need to bootstrap for make dist |
00cad641 A |
107 | #../commit/bootstrap squid-3 |
108 | #make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6 | |
16760e84 | 109 | |
00cad641 A |
110 | #rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
111 | #cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new | |
112 | #chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new | |
113 | #mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/content/CONTRIBUTORS.txt | |
114 | # | |
115 | #rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
116 | #cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
117 | #chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
118 | #mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt | |
7ecf1a1c | 119 | |
de5b2e24 A |
120 | ../commit/bootstrap squid-3.4 |
121 | make_snapshot ../commit/squid-3/mksnapshot.sh 3.4 v3 3.4 30 | |
122 | ||
d3e0e2f9 A |
123 | ../commit/bootstrap squid-3.3 |
124 | make_snapshot ../commit/squid-3/mksnapshot.sh 3.3 v3 3.3 30 | |
125 | ||
de5b2e24 A |
126 | #../commit/bootstrap squid-3.2 |
127 | #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 30 | |
ddaf63b1 | 128 | |
de5b2e24 A |
129 | #../commit/bootstrap squid-3.1 |
130 | #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 30 | |
037ade45 | 131 | |
97f546d1 AJ |
132 | #../commit/bootstrap squid-3.0 |
133 | #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3 | |
16760e84 | 134 | |
029ef05a AJ |
135 | #../commit/bootstrap squid-2 |
136 | #make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3 | |
33835f37 | 137 | |
029ef05a AJ |
138 | #../commit/bootstrap squid-2.7 |
139 | #make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3 | |
f1a01511 | 140 | |
0e8cd610 HN |
141 | #../commit/bootstrap squid-2.6 |
142 | #make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3 | |
16760e84 | 143 | |
031dffde | 144 | #../commit/bootstrap squid-2.5 |
145 | #make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3 | |
16760e84 | 146 | |
147 | #../commit/squid3-SQUID2.sync | |
c007f56f | 148 | |
149 | ||
150 | ../commit/bootstrap squid-3.5 | |
151 | make_snapshot ../commit/squid-3/mksnapshot.sh 3.5 v3 3.5 30 | |
152 |