I felt like I should actually make a useful contribution to balance
the less useful commit-message discussion ;).  Browsing through the
open Portage bugs, #175612 looked interesting.  After I looked at
pym/portage/package/ebuild/fetch.py, I decided to take a step back and
just try and refactor fetch(), which was pushing 1k lines.  Here are
three paches pulling fairly self-contained blocks out of fetch().  I
thought I'd float them to the list to see if this was a productive
avenue, or if this is going to be too much work to review.  I tried to
avoid making too many changes other than the function-extraction, but
in some places I couldn't help myself ;).

The patches aren't particularly well tested yet.  I ran the test suite
and got some errors, but they seemed to be related to my non-root
invocation, and not due to these changes themselves.  I thought I'd
post my work so far, before digging deeper into the test suite.

Cheers,
Trevor

[1]: https://bugs.gentoo.org/show_bug.cgi?id=175612

W. Trevor King (3):
  pym/portage/package/ebuild/fetch.py: Factor out
    _get_checksum_failure_max_tries
  pym/portage/package/ebuild/fetch.py: Factor out _get_fetch_resume_size
  pym/portage/package/ebuild/fetch.py: Factor out _get_uris

 pym/portage/package/ebuild/fetch.py | 305 +++++++++++++++++++++---------------
 1 file changed, 177 insertions(+), 128 deletions(-)

-- 
1.8.5.2.8.g0f6c0d1


Reply via email to