insights-core
insights-core copied to clipboard
[RFC] gathering information about a package Requires:
Hi guys,
I am currently both learning python and Insights. In order to write a rule I need to be able to gather a given package Requires:.
I can see that we already collect a lot of rpm information via specs/default.py and perhaps it might be enough to extend the query format to include Requires. Another option might be to create a new parser for the specific task.
Being new to the project and python, I am seeking some guidance on how it's best to proceed.
Ideally the output from the parser or the extension would match (shell code):
for i in $(rpm -qR $package | awk '{print $1}' | grep -v rpmlib); do
rpm -q --whatprovides "$i" --qf "%{NAME}\n"
done | sort -u
Thanks for the advice Fabio
@xiangce I remember Rob said the variable is not parsed in SPEC, did we have solution yet? Thanks!
@xhe123 we don't need a variable if we add the %{REQUIRENAME} to specs/default.py rpm -qa query and save the data there.