I am triyng to get the major version of the package but some how “tuple or item” doesnt work.
the query is
(tuple string item 0 of concatenation “.” of substrings separated by “-” of it) of ((version of package “splunkforwarder” of rpm) as string)
6.6.2-4b804538c686.1
I just want get the “6” the first character from the version.
SLB
December 6, 2018, 6:45pm
2
How about
preceding texts of firsts "." of (versions of packages "splunkforwarder" of rpm as string)
yay… thanks SLB. Appreciate your help.
I did this to pull that off but your is much simpler version.
(tuple string item 0 of concatenation ", " of substrings separated by “.” of it) of (concatenation “.” of substrings separated by “-” of it) of ((version of package “splunkforwarder” of rpm) as string)
is ths correct way of doing it?
if ( preceding texts of firsts “.” of (versions of packages “splunkforwarder” of rpm as string) < 6)
then update package
else false
SLB
December 7, 2018, 11:50am
5
I think you can do away with parsing the major version. If I use the BESAgent package as an example
Q: version of package "BESAgent" of rpm < "10"
A: True
Q: version of package "BESAgent" of rpm < "9"
A: False
To cater for systems that do not have the package, this approach is cleaner and should avoid having to use relevance checks in the action
Q: exists package "BESAgent" whose (version of it < "10") of rpm
A: True
Q: exists package "ItsNotHere" whose (version of it < "10") of rpm
A: False
2 Likes
Thanks SLB. Appreciate your help.