LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (http://www.linuxquestions.org/questions/gentoo-87/)
-   -   Trying to build Gentoo Prefix in Mac OS - ftp unknown host error (http://www.linuxquestions.org/questions/gentoo-87/trying-to-build-gentoo-prefix-in-mac-os-ftp-unknown-host-error-4175419426/)

nokangaroo 07-30-2012 03:36 PM

Trying to build Gentoo Prefix in Mac OS - ftp unknown host error
 
I just downloaded the bootstrap-prefix script, but when I run it, it gives an "unknown host" error and terminates with an ftp prompt. It is NOT a connection problem, because the file exists and I can download it by hand. So what is wrong? Is Gentoo on the Mac a bad idea in the first place, if I run into trouble so soon?

nokangaroo 07-30-2012 04:27 PM

Solved - installed wget via MacPorts and changed line 37 in the script to

Code:

FETCH_COMMAND="/opt/local/bin/wget"
So Gentoo relies on the competition to work????? That's weird, dude.

segmentation_fault 07-31-2012 03:48 AM

Quote:

Originally Posted by nokangaroo (Post 4741628)

So Gentoo relies on the competition to work????? That's weird, dude.

What do you mean by that? What competition? I just downloaded and burned the minimal install iso to get it working. I used a server running slackware at that time with only cli to do that.

nokangaroo 08-03-2012 07:46 AM

Thank you, segmentation_fault. I was making a joke (and talking of gentoo prefix on Max OS X).

I was actually coming back to suggest a change to bootstap-prefix.sh:

Instead of (lines 31 through 50):
Code:

efetch() {
        if [[ ! -e ${DISTDIR}/${1##*/} ]] ; then
                if [[ -z ${FETCH_COMMAND} ]] ; then
                        # Try to find a download manager, we only deal with wget,
                        # curl, FreeBSD's fetch and ftp.
                        if [[ x$(type -t wget) == "xfile" ]] ; then
                                FETCH_COMMAND="wget"
                        elif [[ x$(type -t ftp) == "xfile" ]] ; then
                                FETCH_COMMAND="ftp"
                        elif [[ x$(type -t curl) == "xfile" ]] ; then
                                einfo "WARNING: curl doesn't fail when downloading fails, please check its output carefully!"
                                FETCH_COMMAND="curl -L -O"
                        elif [[ x$(type -t fetch) == "xfile" ]] ; then
                                FETCH_COMMAND="fetch"
                        else
                                eerror "no suitable download manager found (need wget, curl, fetch or ftp)"
                                eerror "could not download ${1##*/}"
                                exit 1
                        fi
                fi

I suggest the following:
Code:

efetch() {
        if [[ ! -e ${DISTDIR}/${1##*/} ]] ; then
                if [[ -z ${FETCH_COMMAND} ]] ; then
                        # Try to find a download manager, we only deal with wget,
                        # curl, FreeBSD's fetch and ftp.
                        if [[ "$(basename `which wget` 2> /dev/null)" == "wget" ]] ; then
                                FETCH_COMMAND=`which wget`
                        elif [[ "$(basename `which curl` 2> /dev/null)" == "curl" ]] ; then
                                einfo "WARNING: curl doesn't fail when downloading fails, please check its output carefully!"
                                FETCH_COMMAND="`which curl` -L -O"
                        elif [["$(basename `which ftp` 2> /dev/null)" == "ftp" ]] ; then
                                FETCH_COMMAND=`which ftp`
                        elif [[ "$(basename `which fetch` 2> /dev/null)" == "fetch" ]] ; then
                                FETCH_COMMAND=`which fetch`
                        else
                                eerror "no suitable download manager found (need wget, curl, fetch or ftp)"
                                eerror "could not download ${1##*/}"
                                exit 1
                        fi
                fi

Note that ftp comes after curl which is installed by default.


All times are GMT -5. The time now is 02:13 PM.