[Piuparts-devel] faster-rdep-calc/rdep-chain-len

Andreas Beckmann anbe at debian.org
Sun Apr 14 12:47:25 UTC 2013


On 2013-04-14 00:36, Dave Steele wrote:
> With that, I think I've addressed the open issues related to
> faster-rdep-calc and rdep-chain-len (BTW, chain-len is now useful -
> resolve-virtual was the fix to cause the waiting-for-dependency count
> to be driven quickly to zero). Some rework remains after the chdir()
> elimination goes to the front of the line, followed by testing. There
> are still a few issues remaining with the original
> detect_well_known_errors submission that I expect to address.

* "packagesdb - Refactor out get_rdep_dict() from calc_rrdep_counts()."
  since is get_rdep_dict() is an internal interface, it should be called
  _get_rdep_dict() for consistency - or do you expect anything outside
PackagesDB to call this?

* "packagesdb.py - Use get_package() in get_rdep_dict() to resolve
virtual pkgs."
  that completely is borked - you probably want to use

  for pkg in self.get_all_packages():
      # use the Packages dependencies() method for a conservative count
      for dep in pkg.dependencies():
         dep_pkg = self.get_package(dep, resolve_virtual=True):
         if dep_pkg is not None:
            dep = dep_pkg["Package"]
         if not dep in self._rdeps:
            self._rdeps[dep] = []
         self._rdeps[dep].append(pkg["Package"])

  and drop the _find_all_packages() call (already done by
  get_all_packages()

* "packagesdb - Add routine to calc rdep metrics by package as needed."
  NACK until you insert a5348699 "lib/db: Package: rename count member
variables" before this patch (and adjust the variable names as I did in
my fa97aaac variant of your patch)
This currently (c8118e1) introduces really bad code due to the name
clash between the Package methods and member variables



More information about the Piuparts-devel mailing list