Gentoo Archives: gentoo-ppc-dev

From: Mark Guertin <gerk@g.o>
To: gentooppc-dev@g.o
Subject: [gentooppc-dev] ARCH checks
Date: Fri, 21 Jun 2002 16:57:48
Message-Id: 200206211757.41344.gerk@gentoo.org
Hello All

Something was brought to my attention today (along with a realization of how 
portage works fr some things) and i want to share it with you all.

For any/all PPC only ebuilds we should put a check so that it doesn't try to 
build on non PPC arches, and that check should be within the first function 
(i.e. src_compile() src_uncompress() or whatever it happens to be).

There were several PPC only builds tha didn't have it like this, and some 
tools being worked on for QA stuff right now check all the ebuilds 
(regardless of ARCH) for deps and the like, and having the check outside of a 
function causes problems as the build drops before it can report on the deps.

Here's an example of how it could look:

src_compile() {
        # if not ppc bail
        if [ ${ARCH} != "ppc" ] ; then
                einfo "Sorry, this is a PPC only utility"
                exit 1
        fi

<snip>

}

This is not the best solution IMHO as it still makes the x86 users dl the src 
tarballs, but it does allow portage to fully test the deps as needed 
currently :(

There should be a more elegant way with the upcoming USE additions, but for 
now this is the best way to do things.

Mark