#!/bin/sh -ex

# Install a set of commonly needed packages into a minimal Ubuntu chroot as
# created by apport-chroot.

[ -f "$1" ] || [ -d "$1" ] || {
    echo "Usage: $0 <chroot path>"
    exit 1
}

cat <<EOF | apport-chroot --save login "$1"
set -ex
apt-get update
dpkg-divert --divert /usr/bin/ucf.disabled --rename /usr/bin/ucf
dpkg-divert --divert /usr/sbin/update-gconf-defaults.disabled --rename /usr/sbin/update-gconf-defaults
/bin/echo -e '#!/bin/sh\nexit 0' > /usr/sbin/update-gconf-defaults
/bin/echo -e '#!/bin/sh\nexit 0' > /usr/bin/ucf

apt-get install -y --allow-unauthenticated libgnome2-0 firefox mozilla-thunderbird libqt3-mt
apt-get clean
EOF
