[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#733489: Remaining patches for bug #733489



On 09/02/2015 11:28 AM, Julian Andres Klode wrote:
On Wed, Sep 2, 2015 at 10:34 AM, Michael Schaller <michael@5challer.de> wrote:
Friendly ping to Julian.  Julian, do you think we can finish this before
your University courses start again?

Sure. I'm sorry I forgot to send this out, but here we go:

No worries.  ;-)

There are some things I don't like currently:

helpers/filter patch:
* The 'for' loops building lists should be comprehensions.
* The early return in is_installed does not make sense, use an 'and' instead
* The 'if' in InstalledFilter.apply should go away, simply return the value.

Sure.  SGTM.

target_versions patch:
* We cannot simply create a new Package() object, the Cache object keeps
   a weak reference to all packages. This needs a slight refactoring by
extracting a
   method out of Cache.__getitem__ that creates the apt.Package for the
apt_pkg.Package.

I see. Looking at cache.py I think the best would be to introduce a Cache._rawpkg_to_pkg method. This would get rid of some code duplication in the Cache class as well as similar code is used in several places.
Julian, is this what you had in mind?

* I'm not sure if Version.__eq__ or whatever should take the name into
consideration,
   it probably should, this would remove the need for the hack and the
long comment.

I'm not sure about how much code relies on this broken behavior. If this isn't a concern for you I'm happy to fix this.


Reply to: