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
1 Hello All
2
3 Something was brought to my attention today (along with a realization of how
4 portage works fr some things) and i want to share it with you all.
5
6 For any/all PPC only ebuilds we should put a check so that it doesn't try to
7 build on non PPC arches, and that check should be within the first function
8 (i.e. src_compile() src_uncompress() or whatever it happens to be).
9
10 There were several PPC only builds tha didn't have it like this, and some
11 tools being worked on for QA stuff right now check all the ebuilds
12 (regardless of ARCH) for deps and the like, and having the check outside of a
13 function causes problems as the build drops before it can report on the deps.
14
15 Here's an example of how it could look:
16
17 src_compile() {
18 # if not ppc bail
19 if [ ${ARCH} != "ppc" ] ; then
20 einfo "Sorry, this is a PPC only utility"
21 exit 1
22 fi
23
24 <snip>
25
26 }
27
28 This is not the best solution IMHO as it still makes the x86 users dl the src
29 tarballs, but it does allow portage to fully test the deps as needed
30 currently :(
31
32 There should be a more elegant way with the upcoming USE additions, but for
33 now this is the best way to do things.
34
35 Mark