Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies