]> git.ipfire.org Git - thirdparty/squid.git/blob - mksnapshot-cron.sh
Bug 5069: Keep listening after getsockname() error (#1713)
[thirdparty/squid.git] / mksnapshot-cron.sh
1 #!/bin/sh -e
2 #
3 ## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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
10 echo "RUN: $0"
11 # Nightly cron job to generate snapshot releases
12 top=${PWD}
13 versions=/server/httpd/htdocs/squid-cache.org/content/Versions/
14 TMPDIR=/home/squidadm/${LOGNAME}.cron
15 export TMPDIR
16 if [ -d ${TMPDIR} ]; then
17 chmod -R +w ${TMPDIR}
18 rm -rf ${TMPDIR}
19 fi
20 mkdir -p ${TMPDIR}
21 trap "echo FAIL-BUILD_snapshot-cron; cd /; chmod -R +w ${TMPDIR}; rm -rf ${TMPDIR}" 0
22
23 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
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
33 mksnap=${1}
34 branch=${2}
35 dir=${3}
36 ver=${4}
37 save=${5:-3}
38 dst=${versions}/${dir}/${ver}
39 out=${6:-`basename $branch`}
40 $mksnap ${branch} ${6} 2>&1 | grep -v "set owner/group"
41 for file in `cat ${out}.out` ; do
42 case ${file} in
43 *-cfgman.tar.gz)
44 type=-cfgman.tar.gz
45 ;;
46 *-langpack.tar.gz)
47 type=-langpack.tar.gz
48 ;;
49 *-manuals.tar.gz)
50 type=-manuals.tar.gz
51 ;;
52 *)
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/'`
54 esac
55
56 # move tarball
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}
62
63 # update snapshot symlink
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
68
69 set +e
70 # cleanup old snapshots
71 ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r*[0-9]${type} | \
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/' | \
73 sort -r | tail +${save} | \
74 while read f; do
75 rm -f ${f} ${f}.md5
76 done
77 set -e
78
79 # update dynamic index pages Last-Modified info
80 touch ${dst}/index.dyn
81
82 # Special cases
83 case ${file} in
84 *-cfgman.tar.gz)
85 mkdir -p ${dst}/cfgman
86 tar -C ${dst}/cfgman -zxf ${dst}/${file}
87 ;;
88 *-cfgman.html)
89 rm -f ${dst}/cfgman.html
90 ln -s ${dst}/${file} ${dst}/cfgman.html
91 ;;
92 *-cfgman.html.gz)
93 rm -f ${dst}/cfgman.html.gz
94 ln -s ${dst}/${file} ${dst}/cfgman.html.gz
95 ;;
96 *-manuals.tar.gz)
97 mkdir -p ${dst}/manuals
98 tar -C ${dst}/manuals -zxf ${dst}/${file}
99 ;;
100 esac
101 done
102 } }
103
104 set +e
105
106 # autotool derived files not kept in trunk, but still need to bootstrap for make dist
107 #../commit/bootstrap squid-3
108 #make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6
109
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
119
120 ../commit/bootstrap squid-3.4
121 make_snapshot ../commit/squid-3/mksnapshot.sh 3.4 v3 3.4 30
122
123 ../commit/bootstrap squid-3.3
124 make_snapshot ../commit/squid-3/mksnapshot.sh 3.3 v3 3.3 30
125
126 #../commit/bootstrap squid-3.2
127 #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 30
128
129 #../commit/bootstrap squid-3.1
130 #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 30
131
132 #../commit/bootstrap squid-3.0
133 #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3
134
135 #../commit/bootstrap squid-2
136 #make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3
137
138 #../commit/bootstrap squid-2.7
139 #make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3
140
141 #../commit/bootstrap squid-2.6
142 #make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3
143
144 #../commit/bootstrap squid-2.5
145 #make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3
146
147 #../commit/squid3-SQUID2.sync
148
149
150 ../commit/bootstrap squid-3.5
151 make_snapshot ../commit/squid-3/mksnapshot.sh 3.5 v3 3.5 30
152