Code review comment for lp:~xnox/ubuntu-release-upgrader/lp1409555

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 13 January 2015 at 23:00, Brian Murray <email address hidden> wrote:
> In the process of tracking down the test failure I also found a method for removing entries from sources.list, sources.list.remove(), and that seems like a better idea to me than creating a new list.

That was my original implementation, however it's no good. As it
iterates the list for each removal invokes comparators to remove the
first item with the matching value from the list. Given that list is
"objects" rather than strings, the value for the "commented" string
did not match. Furthermore in python one is not allowed to modify a
list whilst iterating over it, thus a new list (or copy will be
required). This single pass is cumbersome, but most straight-forward
way to implement it. Or e.g. python3 on trusty has some subtle object
comparison error.

If it works and passes the upgrade test with both trusty & utopic
python3, I'm all happy to use whichever algorithm that gives correct
end-result.

--
Regards,

Dimitri.

« Back to merge proposal