1 |
On Mon, 13 Jan 2014 19:50:44 -0500 |
2 |
Mike Frysinger <vapier@g.o> wrote: |
3 |
|
4 |
> On Monday 13 January 2014 19:08:30 creffett@g.o wrote: |
5 |
> > From: Chris Reffett <creffett@g.o> |
6 |
> > Subject: [gentoo-portage-dev] [PATCH] Add repoman check to warn if |
7 |
> > src_prepare/src_configure are used in EAPI 0/1 |
8 |
|
9 |
Well, I was planning to cover these bugs; seems we really need to |
10 |
organize with regards to avoiding double work, as two others have got |
11 |
the same happen to them. Let's synchronize it. |
12 |
|
13 |
So, what you have done here is wrote a partial patch for this bug: |
14 |
|
15 |
https://bugs.gentoo.org/show_bug.cgi?id=379491 |
16 |
|
17 |
Therefore I suggest you that you mention it in the commit subject. |
18 |
|
19 |
Now that you're working on phases, I wonder whether you plan to deal |
20 |
with the other bug as well: |
21 |
|
22 |
https://bugs.gentoo.org/show_bug.cgi?id=365691 |
23 |
|
24 |
While vapier's case could be considered as valid; I think we should |
25 |
consider that as a bad practice, as one could just as well put the if |
26 |
inside a phase which is the much more common practice. |
27 |
|
28 |
Can you let me know whether you would work on this one as well as to |
29 |
avoid both of us doing the same work on these? |
30 |
|
31 |
As a note, my WIP work is at the next url; there you can see the bug |
32 |
numbers I've been working on (still need to revise them, properly |
33 |
document the added check errors [eg. in `man repoman`] and so on). |
34 |
|
35 |
https://github.com/TomWij/gentoo-portage-next/branches |
36 |
|
37 |
If you do something similar, we could check whether we attempt to work |
38 |
on the same bug; as to avoid clashing. (In this case I think I told |
39 |
you in #gentoo-qa that I planned to do this; but well, then I can be |
40 |
lucky that I've not started on it. ^^) |
41 |
|
42 |
> you might want to set ~/.gitconfig to have your name/email so that |
43 |
> git sendemail uses the right info in the actual e-mail From: field |
44 |
|
45 |
Then what is the From: field that it puts separately into the e-mail |
46 |
itself? Seems quite odd for these to differ; or, is the latter an |
47 |
attempt to mark the author? Then why does the e-mail From: field need |
48 |
to be correct? Afaik it would only use one of both, so only one of both |
49 |
needs to be correct. But that would make the actual question: Which one? |
50 |
|
51 |
> > + undefined_phases_re = |
52 |
> > re.compile(r'^\s*(src_configure|src_prepare)\s*\(\)') |
53 |
> |
54 |
> you use re.match, so technically the ^ is redundant |
55 |
|
56 |
Indeed, they match on a line basis from the beginning of the string. |
57 |
|
58 |
> i'd suggest merging the regex a little: |
59 |
> r'^\ssrc_(configure|prepare)\s*\(\)' |
60 |
|
61 |
Note that the * behind the first \s was lost; so, with the redundant ^ |
62 |
removed and the * put back it would be: |
63 |
|
64 |
r'\s*src_(configure|prepare)\s*\(\)' |
65 |
|
66 |
You can then proceed further and move the re outside: |
67 |
|
68 |
r'\s*src_(configu|prepa)re\s*\(\)' |
69 |
|
70 |
The closing parentheses can also be removed because phase( ) is valid: |
71 |
|
72 |
r'\s*src_(configu|prepa)re\s*\(' |
73 |
|
74 |
(We don't need to account for "phase( invalid )" here; as that results |
75 |
in invalid Bash syntax, which would bail out harder than our checks) |
76 |
|
77 |
But if we would do that, it would be like: |
78 |
|
79 |
r'\s*src_(configu|prepa)re\s*\(\s*\)' |
80 |
|
81 |
> could check for pkg_pretend/pkg_info too (it's new to EAPI 4) |
82 |
|
83 |
+1 |
84 |
|
85 |
> the regex is naive and can match valid ebuilds. consider ones that |
86 |
> handle $EAPI itself and will call the right funcs as necessary. |
87 |
|
88 |
From a QA point of view it seems more preferable to move away from old |
89 |
EAPIs, than to conditionally support them. The common case is that |
90 |
ebuilds move from older to newer EAPI and thus would get these |
91 |
functions as they get to a newer EAPI. |
92 |
|
93 |
Is there an actual case for downgrading back to an older EAPI? |
94 |
|
95 |
If not, conditional code that checks $EAPI has no purpose. |
96 |
|
97 |
-- |
98 |
With kind regards, |
99 |
|
100 |
Tom Wijsman (TomWij) |
101 |
Gentoo Developer |
102 |
|
103 |
E-mail address : TomWij@g.o |
104 |
GPG Public Key : 6D34E57D |
105 |
GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D |