insights-core icon indicating copy to clipboard operation
insights-core copied to clipboard

[RFC] gathering information about a package Requires:

Open fabbione opened this issue 5 years ago • 2 comments

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

fabbione avatar Jan 20 '20 08:01 fabbione

@xiangce I remember Rob said the variable is not parsed in SPEC, did we have solution yet? Thanks!

xhe123 avatar Jan 20 '20 09:01 xhe123

@xhe123 we don't need a variable if we add the %{REQUIRENAME} to specs/default.py rpm -qa query and save the data there.

fabbione avatar Jan 20 '20 11:01 fabbione