OSX: Fixed a bug in OS_VER variable.

the old version (grep -o '[0-9]*\.[0-9]*\.[0-9]*') won't detect versions as 10.8, or 10.7
added cut -d: -f2 | sed -e 's/[^0-9]*//' , matching both 10.8, 10.7.4, etc.
This commit is contained in:
meeh
2012-08-11 11:40:05 +00:00
parent d2a5595df2
commit f5b808b997

View File

@@ -359,7 +359,7 @@ esac
# Resolve the architecture
if [ "$DIST_OS" = "macosx" ]
then
OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*'`
OS_VER=`sw_vers | grep ProductVersion | cut -d: -f2 | sed -e 's/[^0-9]*//'`
DIST_ARCH="universal"
if [ $(sysctl -n hw.cpu64bit_capable) -eq 1 ]; then
DIST_BITS="64"