#!/bin/sh
#
# Check tasksel/limit-tasks to determine whether the task should be displayed.
# This option can be preseeded to allow only a subset of task choices.

set -e

TASK=$1

. /usr/share/debconf/confmodule

if db_fget tasksel/limit-tasks seen && [ "$RET" = true ]; then
	db_get tasksel/limit-tasks
	LIMIT="$(echo "$RET" | sed 's/,/ /g')"

	for one_limit in $LIMIT; do
		if [ "$one_limit" = "$TASK" ]; then
			exit 0
		fi
	done

	exit 1
else
	exit 0
fi
