1 |
Am 19.01.2014 04:07, schrieb W. Trevor King: |
2 |
> I felt like I should actually make a useful contribution to balance |
3 |
> the less useful commit-message discussion ;). Browsing through the |
4 |
> open Portage bugs, #175612 looked interesting. After I looked at |
5 |
> pym/portage/package/ebuild/fetch.py, I decided to take a step back and |
6 |
> just try and refactor fetch(), which was pushing 1k lines. Here are |
7 |
> three paches pulling fairly self-contained blocks out of fetch(). I |
8 |
> thought I'd float them to the list to see if this was a productive |
9 |
> avenue, or if this is going to be too much work to review. I tried to |
10 |
> avoid making too many changes other than the function-extraction, but |
11 |
> in some places I couldn't help myself ;). |
12 |
|
13 |
Good idea. |
14 |
|
15 |
> |
16 |
> The patches aren't particularly well tested yet. I ran the test suite |
17 |
> and got some errors, but they seemed to be related to my non-root |
18 |
> invocation, and not due to these changes themselves. I thought I'd |
19 |
> post my work so far, before digging deeper into the test suite. |
20 |
|
21 |
The tests can be run as non-root user. Make sure all the files in the |
22 |
git repo are +rw for that user. |
23 |
|
24 |
You should check the result using pyflakes. |
25 |
|
26 |
Do you have these patches in the publicly accessible git repo? |
27 |
|
28 |
> |
29 |
> Cheers, |
30 |
> Trevor |
31 |
> |
32 |
> [1]: https://bugs.gentoo.org/show_bug.cgi?id=175612 |
33 |
> |
34 |
> W. Trevor King (3): |
35 |
> pym/portage/package/ebuild/fetch.py: Factor out |
36 |
> _get_checksum_failure_max_tries |
37 |
> pym/portage/package/ebuild/fetch.py: Factor out _get_fetch_resume_size |
38 |
> pym/portage/package/ebuild/fetch.py: Factor out _get_uris |
39 |
> |
40 |
> pym/portage/package/ebuild/fetch.py | 305 +++++++++++++++++++++--------------- |
41 |
> 1 file changed, 177 insertions(+), 128 deletions(-) |
42 |
> |