#!/bin/sh -e
# Nightly cron job to generate snapshot releases
top=$PWD
-versions=/server/httpd/htdocs/squid-cache.org/Versions/
+versions=/server/httpd/htdocs/squid-cache.org/content/Versions/
TMPDIR=/home/squidadm/$LOGNAME.cron
export TMPDIR
if [ -d $TMPDIR ]; then
# autotool derived files not kept in trunk, but still need to bootstrap for make dist
../commit/bootstrap squid-3
-make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 HEAD 6
+make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6
rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
-mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.txt
+mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/content/CONTRIBUTORS.txt
rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new
cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new
chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new
-mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/SPONSORS.txt
+mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt
../commit/bootstrap squid-3.1
make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 3
BZRROOT=${BZRROOT:-/bzr}
# generate a tarball name from the branch ($1) note that trunk is at
-# /bzr/trunk, but we call it HEAD for consistency with CVS (squid 2.x), and
+# /bzr/trunk, but we call it 3.HEAD for consistency with CVS (squid 2.x), and
# branches are in /bzr/branches/ but we don't want 'branches/' in the tarball
# name so we strip that.
branchpath=${1:-trunk}
./configure --silent
make -s dist-all
-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
-
-# 3.HEAD shows up as /v3/3.HEAD in the above. do it special.
-if (echo $VERSION | grep HEAD); then
- basetarball=/server/httpd/htdocs/squid-cache.org/Versions/v`echo $VERSION | cut -d. -f1`/`echo $VERSION | cut -d. -f2|cut -d- -f1`/${PACKAGE}-${VERSION}.tar.bz2
+webbase=/server/httpd/htdocs/squid-cache.org/content/
+basetarball=${webbase}/Versions/v`echo $VERSION | cut -d. -f1`/`echo $VERSION | cut -d. -f-2|cut -d- -f1`/${PACKAGE}-${VERSION}.tar.bz2
+
+echo "Building Tarball diff (${basetarball}) ..."
+if [ -f $basetarball ]; then
+ tar jxf ${PACKAGE}-${VERSION}-${date}.tar.bz2
+ tar jxf $basetarball
+ echo "Differences from ${PACKAGE}-${VERSION} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
+ diff -ruN ${PACKAGE}-${VERSION} ${PACKAGE}-${VERSION}-${date} >>${PACKAGE}-${VERSION}-${date}.diff || true
+else
+ echo "Building Tarball diff ... skipped (no tarball exists)."
fi
-#if (echo $VERSION | grep PRE) || (echo $VERSION | grep STABLE); then
- echo "Building Tarball diff (${basetarball}) ..."
- if [ -f $basetarball ]; then
- tar jxf ${PACKAGE}-${VERSION}-${date}.tar.bz2
- tar jxf $basetarball
- echo "Differences from ${PACKAGE}-${VERSION} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
- diff -ruN ${PACKAGE}-${VERSION} ${PACKAGE}-${VERSION}-${date} >>${PACKAGE}-${VERSION}-${date}.diff || true
- else
- echo "Building Tarball diff ... skipped (no tarball exists)."
- #cvs -q rdiff -u -r SQUID_`echo $VERSION | tr .- __` -r $tag $module >>${PACKAGE}-${VERSION}-${date}.diff || true
- fi
-#elif [ -f STABLE_BRANCH ]; then
- #stable=`cat STABLE_BRANCH`
- #echo "Differences from ${stable} to ${PACKAGE}-${VERSION}-${date}" >${PACKAGE}-${VERSION}-${date}.diff
- #cvs -q rdiff -u -r $stable -r $tag $module >>${PACKAGE}-${VERSION}-${date}.diff
-#else
-# echo "Building Tarball ... skipped."
-#fi
-
cd $startdir
echo "Preparing to publish: $tmpdir/${PACKAGE}-${VERSION}-${date}.tar.* ..."
#echo "LOCAL: " ; pwd
fi
# Generate language-pack tarballs
-# NP: Only to be done on HEAD branch.
-if test "${VERSION}" = "3.HEAD" ; then
+# NP: Only to be done on trunk.
+if test "${tag}" = "trunk" ; then
sh -c "cd $tmpdir/errors && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${date}-langpack.tar.gz ./*/* ./alias* ./TRANSLATORS ./COPYRIGHT "
echo ${PACKAGE}-${VERSION}-${date}-langpack.tar.gz >>${tag}.out
fi