#!/bin/sh

set -e

# Install popularity-contest but remove it if the user decides not to
# participate. Use --no-recommends to avoid pulling in an MTA.
if apt-install --no-recommends popularity-contest; then
	if ! grep -q '^PARTICIPATE=\"*yes\"*' /target/etc/popularity-contest.conf; then
		in-target dpkg --purge popularity-contest
	fi
fi
