~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/publishing/maintenance-check.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-03 05:05:39 UTC
  • mfrom: (14514.3.5 new-python-apt)
  • Revision ID: launchpad@pqm.canonical.com-20120103050539-y6ipuo5e9illcrsr
[r=benji][bug=551510] Port to new python-apt API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
    :return: A list of binary package names.
103
103
    """
104
104
    pkgnames = set()
105
 
    recs = apt_pkg.GetPkgSrcRecords()
106
 
    while recs.Lookup(srcname):
107
 
        for binary in recs.Binaries:
 
105
    recs = apt_pkg.SourceRecords()
 
106
    while recs.lookup(srcname):
 
107
        for binary in recs.binaries:
108
108
            pkgnames.add(binary)
109
109
    return pkgnames
110
110
 
163
163
    # open cache with our just prepared rootdir
164
164
    cache = apt.Cache(rootdir=rootdir)
165
165
    try:
166
 
        cache.update(apt.progress.FetchProgress())
 
166
        cache.update()
167
167
    except SystemError:
168
168
        logging.exception("cache.update() failed")
169
169
 
348
348
    # they are not in any seed and got added manually into "main"
349
349
    for arch in PRIMARY_ARCHES:
350
350
        rootdir = "./aptroot.%s" % distro
351
 
        apt_pkg.Config.Set("APT::Architecture", arch)
 
351
        apt_pkg.config.set("APT::Architecture", arch)
352
352
        cache = apt.Cache(rootdir=rootdir)
353
353
        try:
354
 
            cache.update(apt.progress.FetchProgress())
 
354
            cache.update()
355
355
        except SystemError:
356
356
            logging.exception("cache.update() failed")
357
 
        cache.open(apt.progress.OpProgress())
 
357
        cache.open()
358
358
        for pkg in cache:
359
359
            if not pkg.name in pkg_support_time:
360
360
                pkg_support_time[pkg.name] = support_timeframe[-1][0]