# vim: ft=zsh noet
if [[ $1 == info ]]; then
	FSB_INFO_DEPEND=gentoo_dev
	FSB_INFO_BASE=%s
	if (($+STAGE_GENTOO_EMPTYTREE)); then
		FSB_INFO_DIR=%s-emptytree
	else
		FSB_INFO_DIR=%s-system
	fi
	return
elif [[ $1 != build ]]; then
	die "unimplemented action: $*"
fi

fsb_gentoo_profile_add -o ccx-bootstrap mix-ins/circlebreak

if (($+STAGE_GENTOO_EMPTYTREE)); then
	fsb_emerge --emptytree @world
else
	fsb_emerge -u1 perl
	fsb_chroot_bash perl-cleaner --all
	fsb_emerge_hackfix -uDN @world
	fsb_emerge_hackfix -uDN --with-bdeps=y @world
fi
fsb_emerge -n gentoolkit
sed -i '/circlebreak/d' $build_dir/var/portage/local/profiles/custom/parent || die
fsb_emerge_hackfix -uDN @world
fsb_gentoo_post_update