]> git.ipfire.org Git - thirdparty/squid.git/blame - mksnapshot.sh
Bug #2063: Hide debugging messages before cache.log is opened
[thirdparty/squid.git] / mksnapshot.sh
CommitLineData
7aef1654 1#!/bin/sh -e
2if [ $# -gt 1 ]; then
3 echo "Usage: $0 [branch]"
4 exit 1
5fi
e14c0072 6module=squid3
7aef1654 7tag=${1:-HEAD}
8startdir=$PWD
10f7190b 9date=`env TZ=GMT date +%Y%m%d`
7aef1654 10
bf97dee2 11tmpdir=${TMPDIR:-${PWD}}/${module}-${tag}-mksnapshot
7aef1654 12
13CVSROOT=${CVSROOT:-/server/cvs-server/squid}
14export CVSROOT
15
16rm -rf $tmpdir
17trap "rm -rf $tmpdir" 0
18
19be127e 19rm -f ${tag}.out
e14c0072 20cvs -Q export -d $tmpdir -r $tag $module
7aef1654 21if [ ! -f $tmpdir/configure ]; then
e14c0072 22 echo "ERROR! Tag $tag not found in $module"
7aef1654 23fi
24
25cd $tmpdir
66d21f95 26eval `grep "^ *VERSION=" configure | sed -e 's/-CVS//'`
27eval `grep "^ *PACKAGE=" configure`
7aef1654 28ed -s configure.in <<EOS
79325308 29g/${VERSION}-CVS/ s//${VERSION}-${date}/
7aef1654 30w
31EOS
32ed -s configure <<EOS
79325308 33g/${VERSION}-CVS/ s//${VERSION}-${date}/
7aef1654 34w
35EOS
36
37./configure --silent
19be127e 38make -s dist-all
7aef1654 39
05a55a90 40basetarball=/server/httpd/htdocs/squid-cache.org/Versions/v`echo $VERSION | cut -d. -f1`/`echo $VERSION | cut -d. -f-2|cut -d- -f1`/${PACKAGE}-${VERSION}.tar.bz2
79325308 41if (echo $VERSION | grep PRE) || (echo $VERSION | grep STABLE); then
42 echo "Differences from ${PACKAGE}-${VERSION} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
43 if [ -f $basetarball ]; then
44 tar jxf ${PACKAGE}-${VERSION}-${date}.tar.bz2
45 tar jxf $basetarball
46 diff -ruN ${PACKAGE}-${VERSION} ${PACKAGE}-${VERSION}-${date} >>${PACKAGE}-${VERSION}-${date}.diff || true
47 else
b83eb902 48 cvs -q rdiff -u -r SQUID_`echo $VERSION | tr .- __` -r $tag $module >>${PACKAGE}-${VERSION}-${date}.diff || true
79325308 49 fi
b8da3ec1 50elif [ -f STABLE_BRANCH ]; then
51 stable=`cat STABLE_BRANCH`
52 echo "Differences from ${stable} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
53 cvs -q rdiff -u -r $stable -r $tag $module >>${PACKAGE}-${VERSION}-${date}.diff
79325308 54fi
55
7aef1654 56cd $startdir
57cp -p $tmpdir/${PACKAGE}-${VERSION}-${date}.tar.gz .
19be127e 58echo ${PACKAGE}-${VERSION}-${date}.tar.gz >>${tag}.out
c6a26ddb 59cp -p $tmpdir/${PACKAGE}-${VERSION}-${date}.tar.bz2 .
71918ca5 60echo ${PACKAGE}-${VERSION}-${date}.tar.bz2 >>${tag}.out
79325308 61if [ -f $tmpdir/${PACKAGE}-${VERSION}-${date}.diff ]; then
62 cp -p $tmpdir/${PACKAGE}-${VERSION}-${date}.diff .
63 echo ${PACKAGE}-${VERSION}-${date}.diff >>${tag}.out
64fi
19be127e 65
c6a26ddb 66relnotes=$tmpdir/doc/release-notes/release-`echo $VERSION | cut -d. -f1,2 | cut -d- -f1`.html
67if [ -f $relnotes ]; then
68 cp -p $relnotes ${PACKAGE}-${VERSION}-${date}-RELEASENOTES.html
69 echo ${PACKAGE}-${VERSION}-${date}-RELEASENOTES.html >>${tag}.out
a6528f8d 70 ed -s ${PACKAGE}-${VERSION}-${date}-RELEASENOTES.html <<EOF
71g/"ChangeLog"/ s//"${PACKAGE}-${VERSION}-${date}-ChangeLog.txt"/g
72w
73EOF
c6a26ddb 74fi
f2cc0e97 75cp -p $tmpdir/ChangeLog ${PACKAGE}-${VERSION}-${date}-ChangeLog.txt
76echo ${PACKAGE}-${VERSION}-${date}-ChangeLog.txt >>${tag}.out
b8da3ec1 77
78if [ -x $tmpdir/scripts/www/build-cfg-help.pl ]; then
79 make -C $tmpdir/src cf.data
80 mkdir -p $tmpdir/doc/cfgman
00a4454c 81 $tmpdir/scripts/www/build-cfg-help.pl --version ${VERSION} -o $tmpdir/doc/cfgman $tmpdir/src/cf.data
b8da3ec1 82 sh -c "cd $tmpdir/doc/cfgman && tar -zcf $PWD/${PACKAGE}-${VERSION}-${date}-cfgman.tar.gz *"
83 echo ${PACKAGE}-${VERSION}-${date}-cfgman.tar.gz >>${tag}.out
00a4454c 84 $tmpdir/scripts/www/build-cfg-help.pl --version ${VERSION} -o ${PACKAGE}-${VERSION}-${date}-cfgman.html -f singlehtml $tmpdir/src/cf.data
b8da3ec1 85 gzip -f -9 ${PACKAGE}-${VERSION}-${date}-cfgman.html
86 echo ${PACKAGE}-${VERSION}-${date}-cfgman.html.gz >>${tag}.out
87fi