Gentoo Archives: gentoo-dev

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

Replies