Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Cc: ssuominen@g.o
Subject: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: udev.eclass
Date: Tue, 30 Oct 2012 19:57:43
Message-Id: 20121030165621.5441b0d6@gentoo.org
1 On Tue, 30 Oct 2012 19:08:39 +0000 (UTC)
2 "Samuli Suominen (ssuominen)" <ssuominen@g.o> wrote:
3
4 [...]
5 >
6 > case ${EAPI:-0} in
7 > 0|1|2|3|4) ;;
8 > *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
9 > established." esac
10
11 sounds like a useless and annoying check for just exporting one function
12
13 >
14 > RDEPEND=""
15
16 useless?
17
18 > DEPEND="virtual/pkgconfig"
19 >
20 > # @FUNCTION: _udev_get_udevdir
21 > # @INTERNAL
22 > # @DESCRIPTION:
23 > # Get unprefixed udevdir.
24 > _udev_get_udevdir() {
25 > if $($(tc-getPKG_CONFIG) --exists udev); then
26 > echo -n "$($(tc-getPKG_CONFIG) --variable=udevdir
27 > udev)" else
28 > echo -n /lib/udev
29 > fi
30 > }
31 >
32 > # @FUNCTION: udev_get_udevdir
33 > # @DESCRIPTION:
34 > # Output the path for the udev directory (not including ${D}).
35 > # This function always succeeds, even if udev is not installed.
36 > # The fallback value is set to /lib/udev
37 > udev_get_udevdir() {
38 > has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
39 > debug-print-function ${FUNCNAME} "${@}"
40 >
41 > echo -n "${EPREFIX}$(_udev_get_udevdir)"
42 > }
43
44 local foo=""
45 unfold _udev_get_udevdir there, replacing 'echo -n' by foo=
46 printf ...$foo
47
48 kill the extra internal fucntion that seems useless.
49 echo isn't really reliable for precise formatting, prefer printf when
50 it matters. (in this case it doesn't matter but seems good practices)
51
52 have you checked what is the udevdir value on prefix, if at all
53 relevant ? I fear a double prefix issue.

Replies