Gentoo Archives: gentoo-dev

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

Replies