Re: [PATCH v2 4/5] qt-utils.eclass: Introduce qt_get_broot_binary()

Ionen Wolkens <[email protected]> Mon, 13 Jul 2026 18:39:14 -0400
Newsgroups gmane.linux.gentoo.devel
Message-ID <alVpEsjYGHl5KTb_@eversor>
--XRs10YfF9rKTpZvD
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 13, 2026 at 11:16:58PM +0100, James Le Cuirot wrote:
> On Sat, 2026-07-11 at 11:57 +0200, Andreas Sturmlechner wrote:
> > Signed-off-by: Andreas Sturmlechner <[email protected]>
> > ---
> >  eclass/qt-utils.eclass | 25 ++++++++++++++++++++++---
> >  1 file changed, 22 insertions(+), 3 deletions(-)
> >=20
> > diff --git a/eclass/qt-utils.eclass b/eclass/qt-utils.eclass
> > index ba425a9db777..588904446bf8 100644
> > --- a/eclass/qt-utils.eclass
> > +++ b/eclass/qt-utils.eclass
> > @@ -18,7 +18,8 @@ if [[ -z ${_QT_UTILS_ECLASS} ]]; then
> >  _QT_UTILS_ECLASS=3D1
> > =20
> >  case ${EAPI} in
> > -	8|9) ;;
> > +	8) inherit eapi9-pipestatus ;;
> > +	9) ;;
> >  	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
> >  esac
> > =20
> > @@ -36,7 +37,7 @@ _qt_eapi9_banned_deprecated_func() {
> > =20
> >  	case ${FUNCNAME[1]} in
> >  		qt6_get_bindir|qt6_get_libexecdir)
> > -			_deprecated_use_instead ${FUNCNAME[1]} "${FUNCNAME[1]/qt6/qt} 6"
> > +			_deprecated_use_instead ${FUNCNAME[1]} "qt_get_broot_binary 6 <bina=
ry>' or '${FUNCNAME[1]/qt6/qt} 6"
> >  			[[ ${FUNCNAME[1]} =3D=3D qt6_get_bindir ]] &&
> >  				eqawarn "    IMPORTANT: qt_get_bindir no longer prepends EPREFIX,"=
 &&
> >  				eqawarn "               which likely was wrong to begin with."
> > @@ -55,7 +56,13 @@ _qt_eapi9_banned_deprecated_func() {
> >  # @DESCRIPTION:
> >  # Checks parameters of public, parent qt_get_* functions for validity.
> >  _qt_get_check_func_call() {
> > -	[[ $# -ne 1 ]] && die "${FUNCNAME[1]}: must be passed exactly one arg=
ument"
> > +	[[ ${FUNCNAME[2]} =3D=3D qt_get_* ]] && return # don't check twice
> > +	case ${FUNCNAME[1]} in
> > +		qt_get_broot_binary)
> > +			[[ $# -ne 2 ]] && die "${FUNCNAME[1]}: must be passed exactly two a=
rguments" ;;
> > +		*)
> > +			[[ $# -ne 1 ]] && die "${FUNCNAME[1]}: must be passed exactly one a=
rgument" ;;
> > +	esac
> >  	case ${1} in
> >  		6) ;;
> >  		*) die "${FUNCNAME[1]}: Qt ${1} is not supported" ;;
> > @@ -90,6 +97,18 @@ qt_get_bindir() {
> >  	echo "$(_qt_get_archdatadir "$@")/bin"
> >  }
> > =20
> > +# @FUNCTION: qt_get_broot_binary
> > +# @USAGE: <qt_maj_ver> <binary name>
> > +# @DESCRIPTION:
> > +# Echoes the BROOT prefixed path to a specific Qt binary, regardless w=
hether
> > +# located in bindir or libexecdir.
> > +qt_get_broot_binary() {
> > +	_qt_get_check_func_call "$@"
> > +	PATH=3D${BROOT}$(qt_get_libexecdir ${1}):${BROOT}$(qt_get_bindir ${1}=
) \
> > +		type -P "${2}" | head -n 1
> > +	pipestatus || die "${FUNCNAME[0]}: failed trying to detect binary: ${=
2}"
>=20
> I think "type -P" only ever returns one result unless you also specify -a.

Huh, I wonder what gave me that impression... I'm the one that told
asturm about that (so my bad), but I normally don't check for multiple
lines and should've known this already. Think I got confused with
something else.

I'll go ahead and swap these for a normal `die` myself without going
through ML again.

>=20
> > +}
> > +
> >  # @FUNCTION: qt_get_headerdir
> >  # @USAGE: <qt_maj_ver>
> >  # @DESCRIPTION:



--=20
ionen

--XRs10YfF9rKTpZvD
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQFPBAABCAA5FiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmpVaREbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJELJEBrCwrEM0isIH/02zq883bthFFsw/3Ok/
lQEkSKKXwTSX8pKGZOWlIHl8/0DYFSd0oX5KMw85BJ+3GzEzT7XzDjCclqw3PFnn
XbxDWwh2Ti4hveODoKmjs9Yi3kw+z6tcaA2xtmQI2tnS+7niL8jMUnxdoC2pa9xH
5Y27w53JI+1XRBWrUUzjwq9WsRQNZSkvROuJ7F+QcRGTVL+M1lCIjshWQNQ+YibT
PHlzkWt9Z5MYHyQL/8LTZp/Qp/CubhgzmSKHkIeugJDnB+/nBDqoWsXGAYy8/0MR
OlEWX9Mbj6pa5TdCr3Gu9WPVYajLeRiQGw8xEw59T/0fKBCub3HLzeirJiolfexQ
Z+g=
=0lu8
-----END PGP SIGNATURE-----

--XRs10YfF9rKTpZvD--