case "$MODE" in
    commandline)
        add_option "mirror" "`eval_gettext "Set the mirror locations (space-separated)"`" "regular" "true"
        add_option "auto-mirror" "`eval_gettext "Try to autodetect good mirror locations"`" "regular" "false"
        add_option "extra-mirror" "`eval_gettext "add a mirror"`" "advanced" "true"
        ;;
    configure)
        if [ -n "$option_mirror_value" ]; then
            MIRROR="$option_mirror_value"
        fi
        if [ -n "$option_extra_mirror_value" ]; then
            EXTRA_MIRROR="$option_extra_mirror_value"
        fi
        ;;
    after-install)
        set_mirrors() {
            echo GENTOO_MIRRORS="$@" >> $ROOT/etc/make.conf
        }

        add_auto_mirrors() {
            if [ "$option_auto_mirror_value" = "true" ]; then
                mirrorselect -s3 -b10 -o >> $ROOT/etc/make.conf
            fi
        }

        set_mirrors "$MIRROR" 
        add_auto_mirrors
esac
