From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 74E8B138334 for ; Wed, 3 Oct 2018 09:23:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB95BE09CE; Wed, 3 Oct 2018 09:23:40 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 90333E099C for ; Wed, 3 Oct 2018 09:23:40 +0000 (UTC) Received: from red.yakaraplc.local (host213-123-185-55.in-addr.btopenworld.com [213.123.185.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chewi) by smtp.gentoo.org (Postfix) with ESMTPSA id 10CA2335D02 for ; Wed, 3 Oct 2018 09:23:37 +0000 (UTC) Date: Wed, 3 Oct 2018 10:23:32 +0100 From: James Le Cuirot To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] xdg-utils.eclass: don't call binaries from ROOT Message-ID: <20181003102328.54aa5a30@red.yakaraplc.local> In-Reply-To: <1538552033.1042.0.camel@gentoo.org> References: <20181003021638.2475-1-floppym@gentoo.org> <1538552033.1042.0.camel@gentoo.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: c916fe1d-8b78-40e4-8460-70b1a277d5a8 X-Archives-Hash: ad11c27c645ff3a749e75e7a6eb496fa On Wed, 03 Oct 2018 09:33:53 +0200 Micha=C5=82 G=C3=B3rny wrote: > On Tue, 2018-10-02 at 22:16 -0400, Mike Gilbert wrote: > > Avoid calling binaries that may have been compiled against different > > libraries or even cross-compiled for an incomatible arch. > >=20 > > Instead, always call the binaries installed in BROOT (/), if > > available. =20 >=20 > Except BROOT doesn't have to be / (that's why we made it into > a variable)! Also, wouldn't it be sufficient to use PATH lookup here > and let the PM handle providing the correct root? To be clearer, EPREFIX refers to the target host, not the build host. The build host may have a different prefix and that is the point of BROOT. But as mgorny says, you should just rely on the PATH. We primarily added BROOT for cases where using the PATH wasn't viable. > > Signed-off-by: Mike Gilbert > > --- > > eclass/xdg-utils.eclass | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass > > index fe1eef213ea4..b133de093082 100644 > > --- a/eclass/xdg-utils.eclass > > +++ b/eclass/xdg-utils.eclass > > @@ -67,7 +67,7 @@ xdg_environment_reset() { > > # Updates the .desktop files database. > > # Generates a list of mimetypes linked to applications that can > > handle them xdg_desktop_database_update() { > > - local updater=3D"${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}" > > + local updater=3D"${EPREFIX}${DESKTOP_DATABASE_UPDATE_BIN}" > > =20 > > if [[ ${EBUILD_PHASE} !=3D post* ]] ; then > > die "xdg_desktop_database_update must be used in > > pkg_post* phases." @@ -88,7 +88,7 @@ xdg_desktop_database_update() { > > # Update the mime database. > > # Creates a general list of mime types from several sources > > xdg_mimeinfo_database_update() { > > - local updater=3D"${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}" > > + local updater=3D"${EPREFIX}${MIMEINFO_DATABASE_UPDATE_BIN}" > > =20 > > if [[ ${EBUILD_PHASE} !=3D post* ]] ; then > > die "xdg_mimeinfo_database_update must be used in > > pkg_post* phases."