It seems like it should be available, but I just can’t seem to find it.
Something like:
pkg = rpm.Package(name="some package")
dependencies = pkg.dependencies()
Is there something like this available, that would be cleaner than what I’m doing now?
Currently, I’m wrapping the rpm command with subprocess and manually parsing the output:
cmd = "rpm -qRp {file} | sort | uniq".format(file=filename)
cmd_output = subprocess.check_output(cmd, shell=True)
# ... long parse of cmd_output
Following scipt will list all Requires from a package provided on commandline (full path to rpm file):
Or alternatively to work with package in rpm database: