Commit 82baf895 authored by Jeremy Katz's avatar Jeremy Katz

api change fixes from tim

parent ffe1f5a2
......@@ -29,17 +29,15 @@ import yum
import os
import sys
import rpm
from rpmUtils import miscutils, transaction
from yum.logger import Logger
from optparse import OptionParser
from yum.packages import YumInstalledPackage
from yum import Errors
def initYum(opts):
my = yum.YumBase()
my.log = Logger(threshold=my.conf.debuglevel,
file_object =sys.stdout)
if opts.orphans:
......@@ -57,8 +55,9 @@ def initYum(opts):
def getLocalRequires(my):
"""Get a list of all requirements in the local rpmdb"""
pkgs = {}
for header in my.rpmdb.getHdrList():
tup = my.rpmdb._hdr2pkgTuple(header)
for po in my.rpmdb.returnPackages():
tup = po.pkgtup
header= po.hdr
requires = zip(
......@@ -118,7 +117,7 @@ def findDupes(my):
refined = {}
dupes = []
for (n,a,e,v,r) in my.rpmdb.pkglists:
for (n,a,e,v,r) in my.rpmdb.simplePkgList():
if not pkgdict.has_key((n,a)):
pkgdict[(n,a)] = []
......@@ -157,7 +156,7 @@ def listLeaves(all):
print "%s-%s-%s.%s" % (pkg[0],pkg[3],pkg[4],pkg[1])
def listOrphans(my):
installed = my.rpmdb.getPkgList()
installed = my.rpmdb.simplePkgList()
for pkgtup in installed:
(n,a,e,v,r) = pkgtup
if n == "gpg-pubkey":
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment