#! /bin/bash


USAGE="[--no-flavour] install <flavour>"

with_flavour=yes

while :
do
	case $1 in
	--no-flavour)
		with_flavour= ;;
	-*)
		usage ;;
	*)
		break
	esac
	shift
done

if test $# -ne 1; then
	usage
fi

#
# check the repo validities
#
kdist__cd_kernel_topdir || exit

config=$(config__resolve_db "$1" "") || exit
echo "Installing $config"

if test -e .config; then
	echo "Previous config saved in .config.old"
	mv -f .config .config.old
fi &&

cp $config .config &&

if ! test $with_flavour; then
	config__unset_symbol NAME .config
fi &&

echo Done.
