As Seth points out, you can use the updates APIs to ask if something is
available as an update. For something that’s close to what the “yum list” does
you probably want to use the doPackageLists(). Eg.
import os, sysimport yumyb = yum.Yumbase()yb.conf.cache = os.geteuid() != 1pl = yb.doPackageLists(patterns=sys.argv[1:])if pl.installed: print "Installed Packages" for pkg in sorted(pl.installed): print pkgif pl.available: print "Available Packages" for pkg in sorted(pl.available): print pkg, pkg.repoif pl.reinstall_available: print "Re-install Available Packages" for pkg in sorted(pl.reinstall_available): print pkg, pkg.repo



