Closed
Description
This is a follow-up task from #4550.
Lines 226 to 228 in 7617610
Lines 115 to 187 in 7617610
sw_vers -productVersion
gives the correct answer, however, it would be better to avoid depending on this binary existing and maintaining this behavior. Furthermore, a peek at the source code (thanks @fengb for finding it) for this file reveals that it depends on the CoreFoundation framework to function, which is another dependency it would be nice to avoid here.
It looks like the answer is in /System/Library/CoreServices/SystemVersion.plist
(thanks @mikdusan for finding it), which is in a simple XML format. Perhaps a prerequisite to this issue would be an XML tokenizer.