I was imagining a 3-line Python script to do this but the yum Python API is impregnable. Is this also possible?
Writing a cover for 'yum list package-name', the only way to do this?
As Seth points out, when you update something as available, Can be used. For some of those who are close to the "yum list" you probably want to use doPackageLists () eg.
import os, sys import yum yb = yum.YumBase () yb.conf.cache = os.geteuid ()! = 1 pl = yb.doPackageLists (Pattern = sys.argv [1:]) If pl.installed: Printed "Installed Package" sorted (pl.installed) in PKG: Print PKG if pl.available: Print "available packages "For the sorted PPG (pl.available): Print PKG, Pkg.repo if pl.reinstall_available: pkg sorted (pl.reinstall_available) for" Restore available packages "Print: print pkg, Pkg.repo
Comments
Post a Comment