#!/bin/sh -e
. /usr/share/debconf/confmodule

anna-install apt-mirror-setup || true

if ! db_get mirror/suite || ! [ "$RET" ]; then
	if [ -f /etc/lsb-release ]; then
		. /etc/lsb-release
		if [ -n "$DISTRIB_CODENAME" ]; then
			db_set mirror/suite "$DISTRIB_CODENAME"
		fi
	fi
fi

choose-mirror

# If a -support udeb is available for the selected release, install it
# This will mostly be used to preserve backwards compatibility with stable
if db_get mirror/codename && [ "$RET" ]; then
       anna-install $RET-support || true
fi
