Rpm package version if condtion,

I need to have this query to upgrade the package if the name of OS is linux and if package exist.

if (name of operating system contains “Linux”)
then
((names of it) of packages whose (name of it contains “XYZ”) of rpm)
if (preceding text of first “.” of (it as string ) of version of package “XYZ” of rpm < “7” )
then "PleaseUpgradeMe"
else "IamHappyCamper"
else “XYZnot found”

I need to put in this way.
If name of opertating systes contains "linux"
then
if package exist and version <7
then
"upgrade package"
else if package don’t exist
then
"install the package"
else “package version is correct”

can this be doable?

It sounds like you want 2 Fixlets. Fixlet #1 will detect “package not present” and the action will install the package. Fixlet #2 will detect if the “package present and old” and the action will upgrade the package.

It is possible to do both in a single Fixlet + action, but if you do it this way, you will not know if the package is missing, or package is present and old.

Fixlet #1 name of operating system contains “Linux” AND not exists package “XYZ” of rpm
Action - download and install XYZ

Fixlet #2 name of operating system contains “Linux” AND exists package “XYZ” whose (version of it <“7”) of rpm
Action - download and upgrade XYZ

To do it your way and with a single fixlet, you would OR the two relevance conditions and in your Action you would need to use an If/Elseif to decide if you need to install or upgrade.
https://developer.bigfix.com/action-script/reference/flow-control/if-elseif-else-endif.html

Thanks brolly33. that gives good idea what to do next.