Comment 4 for bug 205470

Revision history for this message
James Westby (james-w) wrote :

Hi,

The code in question seems to be:

    def run(self, global_options):
        packages = [(p, v) for p, v in read_dpkg_status()
                    if not p in (self.rtname, self.rtname+'-minimal')]
        needed_packages = []
        for pkgname, vstring in packages:
            try:
                requested = list(pyversions.requested_versions(vstring, version_only=True))
            except ValueError:
                logging.info('\tunsupported for %s: %s (%s)' % (self.rtname, pkgname, vstring))
                continue
            if self.runtime.short_name in requested:
                needed_packages.append((pkgname, vstring, requested))
        logging.info('\t%d pycentral supported packages installed, %d for %s'
                     % (len(packages), len(needed_packages), self.rtname))
        try:
            for pkgname, vstring, vinfo in needed_packages:
                logging.info('\trtremove: remove package %s for %s' % (pkgname, self.rtname))
                pkg = DebPackage('package', pkgname)

where the call to DebPackage looks for the /var/lib/dpkg/package.list file. The read_dpkg_status()
function reads /var/lib/dpkg/status for the packages that depend on python-central to get
their requested python versions.

I don't know how dpkg handles these files, if you are removing a package is there a window
in which the files are removed (in particular /var/lib/dpkg/package.list), but the
package is still listed in /var/lib/dpkg/status?

Thanks,

James