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

Bug#733489: Remaining patches for bug #733489



On 07/07/2015 09:00 PM, Julian Andres Klode wrote:
On Sat, Jul 04, 2015 at 03:45:48PM +0200, Michael Schaller wrote:

I merged all except for the last 2 commits, as they seem to introduce a
reference cycle from deps to versions. And we can't have that, as that
leads to enormous issues (#745487).

I might be wrong though, we probably create all dependencies lazily,
but it's still not a good idea to have a path up in the API.

I'll take a closer look at this in a few weeks and might redecide
then. University exams next week and in 3 weeks...


Thanks for merging the 4 patches.

Looking at the next commit in line, which would be https://github.com/michael-schaller/python-apt/commit/5dfd3c5, there shouldn't be an issue.

This commit changes the constructors of Dependency and BaseDependency to store the Version object they belong to. This is in line with the Package and Version classes as they handle this the same way.

With this part of the commit you basically change the constructors from this:
Package(apt.package.Cache, apt_pkg.Package)
Version(apt.package.Package, apt_pkg.Version)
BaseDependency(apt_pkg.Dependency)
Dependency(list(apt.package.BaseDependency), string)

to this:
Package(apt.package.Cache, apt_pkg.Package)
Version(apt.package.Package, apt_pkg.Version)
BaseDependency(apt.package.Version, apt_pkg.Dependency)
Dependency(list(apt.package.Version, apt.package.BaseDependency), string)

As you can see there is no cycle in this arrangement. The target_versions properties don't introduce a cycle either as they only create Version objects that don't backlink to a dependency.


Julian, btw, take your time with your exams. Those are definitely more important than these patches. ;-)


Reply to: