From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 50599138247 for ; Sun, 19 Jan 2014 03:08:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BDD6AE0ABC; Sun, 19 Jan 2014 03:08:24 +0000 (UTC) Received: from qmta02.westchester.pa.mail.comcast.net (qmta02.westchester.pa.mail.comcast.net [76.96.62.24]) by pigeon.gentoo.org (Postfix) with ESMTP id 35AEDE0A63 for ; Sun, 19 Jan 2014 03:08:24 +0000 (UTC) Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71]) by qmta02.westchester.pa.mail.comcast.net with comcast id Ff4j1n0021YDfWL51f8PMK; Sun, 19 Jan 2014 03:08:23 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta20.westchester.pa.mail.comcast.net with comcast id Ff8N1n00S152l3L3gf8PEr; Sun, 19 Jan 2014 03:08:23 +0000 Received: from mjolnir.tremily.us (unknown [192.168.0.140]) by odin.tremily.us (Postfix) with ESMTPS id 4AC93F06ADC; Sat, 18 Jan 2014 19:08:22 -0800 (PST) Received: (nullmailer pid 11655 invoked by uid 1000); Sun, 19 Jan 2014 03:07:53 -0000 From: "W. Trevor King" To: gentoo-portage-dev@lists.gentoo.org Cc: "W. Trevor King" Subject: [gentoo-portage-dev] [PATCH 0/3] Initial fetch() refactoring Date: Sat, 18 Jan 2014 19:07:44 -0800 Message-Id: X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1390100903; bh=EWessVSdd9HiueZY5pEnn0kuPpPWcnQ3bFwks08UVBU=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-Id; b=s0DfTsK61r+ZZLbk8tdB2pCc+Ug+VJ8WUAz8Fqfniwit0kbSZbUhO/kz3RjeC2ZU9 83jFAYeqAGroV+wFC2MpHUcyWkh4NejsAX9HS+9KV2Os0VSTKNfBl2k0uut+fuMNsa Qf4a2HOwVbGlFgJDEINTQu8tv6mJLXpYzi9O9uvxxr1XrU3c6fny2qQvu7ANmru24n w0QjnBk3RCxnvdKi5i8rSUsVkdyL1ni4Rcj00NcwMOxka+iHI1HYWMAf2WtGP0DUNF 7Qnciw9lkXkqmezd+BcF+d9Cu1AC0+9nJut870aaMLt+aCQ51KEV9eyXTF/D90eWZr cWaGRTmg80JTA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: ce6601f6-befd-4467-8aee-a23c49106d50 X-Archives-Hash: ed18c1351ee230333cf8b8e13dfca7d9 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