Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] xdg-utils.eclass: don't call binaries from ROOT
Date: Wed, 03 Oct 2018 09:23:44
Message-Id: 20181003102328.54aa5a30@red.yakaraplc.local
In Reply to: Re: [gentoo-dev] [PATCH] xdg-utils.eclass: don't call binaries from ROOT by "Michał Górny"
1 On Wed, 03 Oct 2018 09:33:53 +0200
2 Michał Górny <mgorny@g.o> wrote:
3
4 > On Tue, 2018-10-02 at 22:16 -0400, Mike Gilbert wrote:
5 > > Avoid calling binaries that may have been compiled against different
6 > > libraries or even cross-compiled for an incomatible arch.
7 > >
8 > > Instead, always call the binaries installed in BROOT (/), if
9 > > available.
10 >
11 > Except BROOT doesn't have to be / (that's why we made it into
12 > a variable)! Also, wouldn't it be sufficient to use PATH lookup here
13 > and let the PM handle providing the correct root?
14
15 To be clearer, EPREFIX refers to the target host, not the build host.
16 The build host may have a different prefix and that is the point of
17 BROOT. But as mgorny says, you should just rely on the PATH. We
18 primarily added BROOT for cases where using the PATH wasn't viable.
19
20 > > Signed-off-by: Mike Gilbert <floppym@g.o>
21 > > ---
22 > > eclass/xdg-utils.eclass | 4 ++--
23 > > 1 file changed, 2 insertions(+), 2 deletions(-)
24 > >
25 > > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
26 > > index fe1eef213ea4..b133de093082 100644
27 > > --- a/eclass/xdg-utils.eclass
28 > > +++ b/eclass/xdg-utils.eclass
29 > > @@ -67,7 +67,7 @@ xdg_environment_reset() {
30 > > # Updates the .desktop files database.
31 > > # Generates a list of mimetypes linked to applications that can
32 > > handle them xdg_desktop_database_update() {
33 > > - local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
34 > > + local updater="${EPREFIX}${DESKTOP_DATABASE_UPDATE_BIN}"
35 > >
36 > > if [[ ${EBUILD_PHASE} != post* ]] ; then
37 > > die "xdg_desktop_database_update must be used in
38 > > pkg_post* phases." @@ -88,7 +88,7 @@ xdg_desktop_database_update() {
39 > > # Update the mime database.
40 > > # Creates a general list of mime types from several sources
41 > > xdg_mimeinfo_database_update() {
42 > > - local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
43 > > + local updater="${EPREFIX}${MIMEINFO_DATABASE_UPDATE_BIN}"
44 > >
45 > > if [[ ${EBUILD_PHASE} != post* ]] ; then
46 > > die "xdg_mimeinfo_database_update must be used in
47 > > pkg_post* phases."

Replies