1 |
On 03/12/2012 02:16 AM, Kent Fredric wrote: |
2 |
> I just find a top-down regexp solution dangerously naive, as its |
3 |
> infering that the first line that matches the regexp *is* the EAPI |
4 |
> requirement field, when depending on the actual format used, that may |
5 |
> not be the case. |
6 |
> |
7 |
> If for example, a format is machine generated, and the EAPI |
8 |
> declaration accidentally comes after something that *isnt* an EAPI |
9 |
> declaration but by the regexp, LOOKS like one, then the probing |
10 |
> mechanism will resolve the WRONG value. |
11 |
> |
12 |
> And that doesn't strike me as being very resilient. |
13 |
|
14 |
It would be very fragile without the sanity check / feedback mechanism |
15 |
that's already been suggested [1]. The idea is to compare the probed |
16 |
EAPI with the result that's obtained from bash, and treat the ebuild as |
17 |
invalid if they are not identical. This would allow ebuilds that don't |
18 |
fit our EAPI probing mechanism to be immediately detected so that the |
19 |
ebuild developer could fix them. In practice, this will not be much of |
20 |
an issue, since the EAPI assignment will be required to be very close to |
21 |
the top of the file, and the package manager will stop searching as soon |
22 |
as it finds the first match. |
23 |
|
24 |
[1] https://bugs.gentoo.org/show_bug.cgi?id=402167#c18 |
25 |
-- |
26 |
Thanks, |
27 |
Zac |