summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2008-04-18 08:49:38 +0200
committerDaniel Baumann <daniel@debian.org>2008-04-18 08:49:38 +0200
commit262ebded3922249fb43c8d49cfaedbfd4390d171 (patch)
tree17b807916a68720a2cffeb0bc14c286407604f9c
parent0cf9ae0b0ec4a6789fe5123817dce5a51c954bed (diff)
downloadvyos-live-build-262ebded3922249fb43c8d49cfaedbfd4390d171.tar.gz
vyos-live-build-262ebded3922249fb43c8d49cfaedbfd4390d171.zip
Updating snapshot build script.
-rwxr-xr-xexamples/cron/snapshots.sh42
1 files changed, 28 insertions, 14 deletions
diff --git a/examples/cron/snapshots.sh b/examples/cron/snapshots.sh
index 6570737c8..10e0a4395 100755
--- a/examples/cron/snapshots.sh
+++ b/examples/cron/snapshots.sh
@@ -1,19 +1,24 @@
#!/bin/sh
-# Needs: build-essential fakeroot lsb-release git-core [...]
-
# Static variables
-PACKAGES="live-helper live-initramfs live-initscripts live-webhelper"
+if [ -n "${1}" ]
+then
+ PACKAGES="${@}"
+else
+ PACKAGES="live-helper live-initramfs live-initscripts live-webhelper"
+fi
DEBEMAIL="debian-live-devel@lists.alioth.debian.org"
EMAIL="debian-live-devel@lists.alioth.debian.org"
DEBFULLNAME="Debian Live Autobuilder"
NAME="Debian Live Autobuilder"
+KEY="FDB8D39A"
-export DEBEMAIL EMAIL DEBFULLNAME NAME
+export DEBEMAIL EMAIL DEBFULLNAME NAME KEY
-TEMPDIR="/srv/tmp/snapshots"
-SERVER="/srv/debian-unofficial/ftp/debian-live-snapshots"
+TEMPDIR="$(mktemp -d -t debian-live.XXXXXXXX)"
+SERVER="/mnt/daniel1/srv/debian-unofficial/live/debian"
+LOGFILE="${SERVER}/build.log"
DATE_START="$(date -R)"
@@ -36,7 +41,7 @@ trap "test -f ${SERVER}/Archive-Update-in-Progress && rm -f ${SERVER}/Archive-Up
# Creating lock file
echo "${DATE_START}" > "${SERVER}"/Archive-Update-in-Progress
-echo "$(date +%b\ %d\ %H:%M:%S) ${HOSTNAME} live-helper: begin snapshot build." >> /var/log/live
+echo "$(date +%b\ %d\ %H:%M:%S) ${HOSTNAME} live-snapshots: begin build." >> "${LOGFILE}"
# Processing packages
for PACKAGE in ${PACKAGES}
@@ -74,8 +79,8 @@ do
# Building package
cd "${TEMPDIR}"/${PACKAGE}-${VERSION}+${REVISION}
rm -rf .git
- dch --force-bad-version --newversion ${VERSION}+${REVISION} --distribution UNRELEASED Autobuild snapshot of SVN r${REVISION}.
- dpkg-buildpackage -rfakeroot -sa -uc -us
+ dch --force-bad-version --newversion ${VERSION}+${REVISION} --distribution UNRELEASED Autobuild snapshot of git ${REVISION}.
+ dpkg-buildpackage -rfakeroot -k${KEY} -sa
# Removing sources
rm -rf "${TEMPDIR}"/${PACKAGE}-${VERSION}+${REVISION}
@@ -113,13 +118,22 @@ then
cd "${SERVER}"
- # Updating binary indices
- apt-ftparchive packages ./ > Packages
+ apt-ftparchive packages . /dev/null > Packages
gzip -9 -c Packages > Packages.gz
+ bzip2 -9 -c Packages > Packages.bz2
- # Updating source indices
- apt-ftparchive sources ./ > Sources
+ apt-ftparchive sources . /dev/null > Sources
gzip -9 -c Sources > Sources.gz
+ bzip2 -9 -c Sources > Sources.bz2
+
+ if [ -f release.conf ]
+ then
+ apt-ftparchive -c release.conf -o APT::FTPArchive::Release::Description="Last updated: `date -R`" release ./ >> Release.tmp
+ mv Release.tmp Release
+
+ rm -f Release.gpg
+ gpg --default-key ${KEY} --quiet --output Release.gpg -ba Release
+ fi
fi
# Reading timestamp
@@ -139,4 +153,4 @@ EOF
# Removing build directory
rm -rf "${TEMPDIR}"
-echo "$(date +%b\ %d\ %H:%M:%S) ${HOSTNAME} live-helper: end snapshot build." >> /var/log/live
+echo "$(date +%b\ %d\ %H:%M:%S) ${HOSTNAME} live-snapshots: end build." >> "${LOGFILE}"