Gentoo Archives: gentoo-dev

From: Donnie Berkholz <dberkholz@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Revbumped php-ext-* eclasses
Date: Wed, 06 Oct 2010 18:07:12
Message-Id: 20101006180641.GB28978@comet.mayo.edu
In Reply to: [gentoo-dev] Revbumped php-ext-* eclasses by Ole Markus With
1 On 13:41 Sun 03 Oct , Ole Markus With wrote:
2 > The eclasses have mostly been revised by me, and I do not have that much
3 > experience writing eclasses/ebuilds, so any comments are highly appreciated.
4
5 > php-ext-pecl-r2_src_install() {
6 > php-ext-source-r2_src_install
7 >
8 > for doc in ${DOCS} "${WORKDIR}"/package.xml CREDITS ; do
9 > [[ -s ${doc} ]] && dodoc ${doc}
10 > done
11 >
12 > if has examples ${IUSE} && use examples ; then
13 > insinto /usr/share/doc/${CATEGORY}/${PF}/examples
14 > doins -r examples/*
15 > fi
16 > }
17
18 Do you want to die if this stuff fails?
19
20 > # @FUNCTION: php-ext-pecl-r2_src_test
21 > # @DESCRIPTION:
22 > # Takes care of running any tests delivered with the PECL package.
23 > # Testing is somewhat standardized across pecl extensions through phpize's
24 > # run-tests.php - unfortunatly there are some quirks we need to work around
25 > php-ext-pecl-r2_src_test() {
26 >
27 > for slot in `php_get_slots`; do
28 > NO_INTERACTION="yes" emake test
29 > done
30
31 emake doesn't die on failure.
32
33 > for target in $USE_PHP; do
34 > IUSE="${IUSE} php_targets_$target"
35 > done
36 >
37 > #Make sure at least one target is installed. Abuses USE dependencies.
38 > for target in $USE_PHP; do
39 > target=${target/+}
40 > SELFDEPEND="$SELFDEPEND =$CATEGORY/$PF[php_targets_$target]"
41 > slot=${target/php}
42 > slot=${slot/-/.}
43 > PHPDEPEND="$PHPDEPEND php_target_$target? ( dev-lang/php:${slot} )"
44 > done
45
46 Why do you iterate over the same list twice? You can just add one more
47 line to the second one and do it all in the same loop.
48
49 > RDEPEND="${RDEPEND}
50 > || ( $SELFDEPEND )
51 > $PHPDEPEND"
52
53 Is that || valid syntax if only one token is in SELFDEPEND? Is it
54 possible for an ebuild to use this eclass without setting USE_PHP?
55
56 --
57 Thanks,
58 Donnie
59
60 Donnie Berkholz
61 Sr. Developer, Gentoo Linux
62 Blog: http://dberkholz.wordpress.com

Replies

Subject Author
Re: [gentoo-dev] Revbumped php-ext-* eclasses Ole Markus With <olemarkus@×××××××××.org>