1 |
On 05/23/2012 08:15 PM, Mike Frysinger wrote: |
2 |
> On Wednesday 23 May 2012 15:21:51 Mike Frysinger wrote: |
3 |
>> + self._inherit_re = re.compile(r'^\s*inherit\s(.*\s)?%s(\s|$)' % |
4 |
> |
5 |
> in scanning the whole tree, this seems to cause some issues (not new) with |
6 |
> extended constructs and not detecting this ebuilds inherits an eclass |
7 |
> directly. some examples: |
8 |
> |
9 |
> (1) |
10 |
> foo="autotools" |
11 |
> ... |
12 |
> inherit ${foo} |
13 |
> this seems pointless imo since we've already ruled that multiple `inherit` |
14 |
> calls are OK |
15 |
|
16 |
Seems reasonable. |
17 |
|
18 |
> (2) |
19 |
> inherit ... \ |
20 |
> autotools |
21 |
> this is annoying. maybe we should adapt the core line code to unroll these |
22 |
> before passing to the individual checks ? |
23 |
|
24 |
Yeah, we could do that for all escaped newlines (not just the ones |
25 |
involving inherit). |
26 |
|
27 |
> (3) |
28 |
> [[ ${PV} == "9999" ]] && inherit autotools |
29 |
> this one would require tweaking the regex like so: |
30 |
> (^[[:space:]]*|[[:space:]])inherit |
31 |
|
32 |
Maybe use something like (^[[:space:]]*|[|&]+[[:space:]]*)\b(inherit) |
33 |
like I did here: |
34 |
|
35 |
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a8889947c45a9fa81ca006b333466372b64f0344 |
36 |
|
37 |
That way it's less likely to match the word "inherit" inside of a |
38 |
comment or quoted string. |
39 |
-- |
40 |
Thanks, |
41 |
Zac |