3
# Copyright 2009 Canonical Ltd. This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
6
# Buildd Slave tool to update a debian chroot
8
# Expects build id as arg 1, makes build-id to contain the build
10
# Needs SUDO to be set to a sudo instance for passwordless access
13
CHROOT=/usr/sbin/chroot
14
APTGET=/usr/bin/apt-get
17
ROOT=$HOME/build-$BUILDID/chroot-autobuild
18
OPTIONS="-o DPkg::Options::=--force-confold"
24
echo "Updating debian chroot for build $BUILDID"
26
hostarch=$(dpkg --print-architecture)
30
CHROOT="linux32 $CHROOT"
33
if [ "$hostarch" != "$ARCHITECTURETAG" ]; then
34
CHROOT="linux32 $CHROOT"
40
export DEBIAN_FRONTEND=noninteractive
43
$SUDO $CHROOT $ROOT $APTGET -uy update < /dev/null
44
$SUDO $CHROOT $ROOT $APTGET $OPTIONS -uy --purge dist-upgrade < /dev/null