An extension attribute.
#!/bin/bash
app="/Applications/YourAppHere.app"
comparelen=10
vers=$(defaults read "$app/Contents/Info.plist" CFBundleShortVersionString 2> /dev/null)
if [ "$vers" != "" ]
then
versint=$(echo $vers | sed 's/[^0-9]*//g')
major=$(echo $vers | cut -d. -f-1)
lenmajor=${#major}
(( lenmajor == 1 )) && versint="0${versint}"
len=${#versint}
if (( len > comparelen ))
then
verscomp=$(echo $versint | cut -c-$comparelen)
else
padlen=$(( $comparelen - 1 ))
verscomp=$(echo $versint | sed -e :a -e "s/^.{1,$padlen}$/&0/;ta")
fi
else
verscomp=0
fi
echo "<result>$verscomp</result>"
= Version Numbers you can actually do INTEGER comparisons for your deployment smart groups.
I am working on a complementary project to dynamically create these. They taste great with Patchoo.
Thoughts?
(or keep prodding JAMF here ... https://jamfnation.jamfsoftware.com/featureRequest.html?id=224)
