1 |
commit: 65364fa2fa675ed05152f8fe5e4665cf262ed4b7 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 31 02:02:36 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 31 02:06:03 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=65364fa2 |
7 |
|
8 |
crossdev: don't pick ebuild version from overlay if unmatching KEYWORDS |
9 |
|
10 |
We don't want to e.g. pick a GCC from an overlay if it doesn't |
11 |
have KEYWORDS for our target, which then leads to an early |
12 |
crossdev failure as it obviously can't then emerge GCC. |
13 |
|
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
crossdev | 23 ++++++++++++++++++++--- |
17 |
1 file changed, 20 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/crossdev b/crossdev |
20 |
index 806a66c..287fd53 100755 |
21 |
--- a/crossdev |
22 |
+++ b/crossdev |
23 |
@@ -1194,9 +1194,26 @@ set_links() { |
24 |
fi |
25 |
for s in ${ovl} ${SEARCH_OVERLAYS} ; do |
26 |
if [[ -d ${s}/${cat}/${pkg} ]] ; then |
27 |
- srcdir=${s} |
28 |
- einfo "getting ${cat}/${pkg} from ${srcdir}" |
29 |
- break |
30 |
+ # Versions in an additional non-crossdev overlay may not have the right keywords. |
31 |
+ # e.g. suppose we have sys-devel/gcc in an overlay with just ~arch keywords. |
32 |
+ # (Or not be keyworded for our target arch at all!) |
33 |
+ local search_kw_string= |
34 |
+ |
35 |
+ case "${LVER}" in |
36 |
+ "[stable]") |
37 |
+ search_kw_string="^[~]${TARCH}" |
38 |
+ ;; |
39 |
+ *) |
40 |
+ search_kw_string="${TARCH}" |
41 |
+ ;; |
42 |
+ esac |
43 |
+ |
44 |
+ if grep -qre "KEYWORDS=.*${search_kw_string}" "${s}/${cat}/${pkg}" ; then |
45 |
+ # ... so only skip if we found one which is at least stable. |
46 |
+ srcdir=${s} |
47 |
+ einfo "getting ${cat}/${pkg} from ${srcdir}" |
48 |
+ break |
49 |
+ fi |
50 |
fi |
51 |
done |
52 |
ln -s "${srcdir}"/${cat}/${pkg} "${d}" |