diff options
author | Sam James <sam@gentoo.org> | 2022-01-31 02:02:36 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-01-31 02:06:03 +0000 |
commit | 65364fa2fa675ed05152f8fe5e4665cf262ed4b7 (patch) | |
tree | 0ef8bf23d3c9a6d560f46257a906cead2071e6db /crossdev | |
parent | crossdev: handle rtems targets via newlib (diff) | |
download | crossdev-65364fa2fa675ed05152f8fe5e4665cf262ed4b7.tar.gz crossdev-65364fa2fa675ed05152f8fe5e4665cf262ed4b7.tar.bz2 crossdev-65364fa2fa675ed05152f8fe5e4665cf262ed4b7.zip |
crossdev: don't pick ebuild version from overlay if unmatching KEYWORDS
We don't want to e.g. pick a GCC from an overlay if it doesn't
have KEYWORDS for our target, which then leads to an early
crossdev failure as it obviously can't then emerge GCC.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'crossdev')
-rwxr-xr-x | crossdev | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -1194,9 +1194,26 @@ set_links() { fi for s in ${ovl} ${SEARCH_OVERLAYS} ; do if [[ -d ${s}/${cat}/${pkg} ]] ; then - srcdir=${s} - einfo "getting ${cat}/${pkg} from ${srcdir}" - break + # Versions in an additional non-crossdev overlay may not have the right keywords. + # e.g. suppose we have sys-devel/gcc in an overlay with just ~arch keywords. + # (Or not be keyworded for our target arch at all!) + local search_kw_string= + + case "${LVER}" in + "[stable]") + search_kw_string="^[~]${TARCH}" + ;; + *) + search_kw_string="${TARCH}" + ;; + esac + + if grep -qre "KEYWORDS=.*${search_kw_string}" "${s}/${cat}/${pkg}" ; then + # ... so only skip if we found one which is at least stable. + srcdir=${s} + einfo "getting ${cat}/${pkg} from ${srcdir}" + break + fi fi done ln -s "${srcdir}"/${cat}/${pkg} "${d}" |