]> git.ipfire.org Git - thirdparty/squid.git/blob - mksnapshot.sh
Call testheaders.sh with locally detected shell.
[thirdparty/squid.git] / mksnapshot.sh
1 #!/bin/sh -e
2
3 if [ $# -lt 1 ]; then
4 echo "Usage: $0 [branch]"
5 echo "Where [branch] is the path under /bzr/ to the branch to snapshot."
6 exit 1
7 fi
8 # VCS details
9 module=squid3
10 BZRROOT=${BZRROOT:-/bzr}
11
12 # generate a tarball name from the branch ($1) note that trunk is at
13 # /bzr/trunk, but we call it HEAD for consistency with CVS (squid 2.x), and
14 # branches are in /bzr/branches/ but we don't want 'branches/' in the tarball
15 # name so we strip that.
16 branchpath=${1:-trunk}
17 tag=${2:-`basename $branchpath`}
18 startdir=$PWD
19 date=`env TZ=GMT date +%Y%m%d`
20
21 tmpdir=${TMPDIR:-${PWD}}/${module}-${tag}-mksnapshot
22
23 rm -rf $tmpdir
24 trap "rm -rf $tmpdir" 0
25
26 rm -f ${tag}.out
27 bzr export $tmpdir $BZRROOT/$module/$branchpath || exit 1
28 if [ ! -f $tmpdir/configure ]; then
29 echo "ERROR! Tag $tag not found in $module"
30 fi
31
32 cd $tmpdir
33 eval `grep "^ *VERSION=" configure | sed -e 's/-BZR//' | sed -e 's/-CVS//'`
34 eval `grep "^ *PACKAGE=" configure`
35 ed -s configure.in <<EOS
36 g/${VERSION}-[A-Z]*/ s//${VERSION}-${date}/
37 w
38 EOS
39 ed -s configure <<EOS
40 g/${VERSION}-[A-Z]*/ s//${VERSION}-${date}/
41 w
42 EOS
43
44 ./configure --silent
45 make -s dist-all
46
47 basetarball=/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
48 if (echo $VERSION | grep PRE) || (echo $VERSION | grep STABLE); then
49 if [ -f $basetarball ]; then
50 tar jxf ${PACKAGE}-${VERSION}-${date}.tar.bz2
51 tar jxf $basetarball
52 echo "Differences from ${PACKAGE}-${VERSION} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
53 diff -ruN ${PACKAGE}-${VERSION} ${PACKAGE}-${VERSION}-${date} >>${PACKAGE}-${VERSION}-${date}.diff || true
54 else
55 #cvs -q rdiff -u -r SQUID_`echo $VERSION | tr .- __` -r $tag $module >>${PACKAGE}-${VERSION}-${date}.diff || true
56 fi
57 elif [ -f STABLE_BRANCH ]; then
58 #stable=`cat STABLE_BRANCH`
59 #echo "Differences from ${stable} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
60 #cvs -q rdiff -u -r $stable -r $tag $module >>${PACKAGE}-${VERSION}-${date}.diff
61 fi
62
63 cd $startdir
64 cp -p $tmpdir/${PACKAGE}-${VERSION}-${date}.tar.gz .
65 echo ${PACKAGE}-${VERSION}-${date}.tar.gz >>${tag}.out
66 cp -p $tmpdir/${PACKAGE}-${VERSION}-${date}.tar.bz2 .
67 echo ${PACKAGE}-${VERSION}-${date}.tar.bz2 >>${tag}.out
68 if [ -f $tmpdir/${PACKAGE}-${VERSION}-${date}.diff ]; then
69 cp -p $tmpdir/${PACKAGE}-${VERSION}-${date}.diff .
70 echo ${PACKAGE}-${VERSION}-${date}.diff >>${tag}.out
71 fi
72
73 relnotes=$tmpdir/doc/release-notes/release-`echo $VERSION | cut -d. -f1,2 | cut -d- -f1`.html
74 if [ -f $relnotes ]; then
75 cp -p $relnotes ${PACKAGE}-${VERSION}-${date}-RELEASENOTES.html
76 echo ${PACKAGE}-${VERSION}-${date}-RELEASENOTES.html >>${tag}.out
77 ed -s ${PACKAGE}-${VERSION}-${date}-RELEASENOTES.html <<EOF
78 g/"ChangeLog"/ s//"${PACKAGE}-${VERSION}-${date}-ChangeLog.txt"/g
79 w
80 EOF
81 fi
82 cp -p $tmpdir/ChangeLog ${PACKAGE}-${VERSION}-${date}-ChangeLog.txt
83 echo ${PACKAGE}-${VERSION}-${date}-ChangeLog.txt >>${tag}.out
84
85 if [ -x $tmpdir/scripts/www/build-cfg-help.pl ]; then
86 make -C $tmpdir/src cf.data
87 mkdir -p $tmpdir/doc/cfgman
88 $tmpdir/scripts/www/build-cfg-help.pl --version ${VERSION} -o $tmpdir/doc/cfgman $tmpdir/src/cf.data
89 sh -c "cd $tmpdir/doc/cfgman && tar -zcf $PWD/${PACKAGE}-${VERSION}-${date}-cfgman.tar.gz *"
90 echo ${PACKAGE}-${VERSION}-${date}-cfgman.tar.gz >>${tag}.out
91 $tmpdir/scripts/www/build-cfg-help.pl --version ${VERSION} -o ${PACKAGE}-${VERSION}-${date}-cfgman.html -f singlehtml $tmpdir/src/cf.data
92 gzip -f -9 ${PACKAGE}-${VERSION}-${date}-cfgman.html
93 echo ${PACKAGE}-${VERSION}-${date}-cfgman.html.gz >>${tag}.out
94 fi