Gentoo Archives: gentoo-dev

From: Fabian Groffen <grobian@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: udev.eclass
Date: Tue, 30 Oct 2012 20:07:59
Message-Id: 20121030200610.GD809@gentoo.org
In Reply to: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: udev.eclass by Alexis Ballier
1 On 30-10-2012 16:56:21 -0300, Alexis Ballier wrote:
2 > > # @FUNCTION: _udev_get_udevdir
3 > > # @INTERNAL
4 > > # @DESCRIPTION:
5 > > # Get unprefixed udevdir.
6 > > _udev_get_udevdir() {
7 > > if $($(tc-getPKG_CONFIG) --exists udev); then
8 > > echo -n "$($(tc-getPKG_CONFIG) --variable=udevdir
9 > > udev)" else
10 > > echo -n /lib/udev
11 > > fi
12 > > }
13 > >
14 > > # @FUNCTION: udev_get_udevdir
15 > > # @DESCRIPTION:
16 > > # Output the path for the udev directory (not including ${D}).
17 > > # This function always succeeds, even if udev is not installed.
18 > > # The fallback value is set to /lib/udev
19 > > udev_get_udevdir() {
20 > > has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
21 > > debug-print-function ${FUNCNAME} "${@}"
22 > >
23 > > echo -n "${EPREFIX}$(_udev_get_udevdir)"
24 > > }
25 >
26 > local foo=""
27 > unfold _udev_get_udevdir there, replacing 'echo -n' by foo=
28 > printf ...$foo
29 >
30 > kill the extra internal fucntion that seems useless.
31 > echo isn't really reliable for precise formatting, prefer printf when
32 > it matters. (in this case it doesn't matter but seems good practices)
33
34 echo -n is not always working, but in this case no point in using it at
35 all.
36
37 > have you checked what is the udevdir value on prefix, if at all
38 > relevant ? I fear a double prefix issue.
39
40 I definitely share your concern. (_udev_get_udevdir has a broken
41 implementation, given its contract per documentation)
42
43
44 --
45 Fabian Groffen
46 Gentoo on a different level

Attachments

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