Fix handling of 3-component OS version numbers.
authorGuy Harris <guy@alum.mit.edu>
Sat, 20 Dec 2014 17:47:01 +0000 (09:47 -0800)
committerGuy Harris <guy@alum.mit.edu>
Sat, 20 Dec 2014 17:47:50 +0000 (17:47 +0000)
Get rid of doubled square brackets (what were those for?), and match
dots in the version number with "\.", so we only match dots.

This fixes the handling of version numbers such as 10.10.1.

(A 2-component version number doesn't match, but that's OK - the sed
command doesn't use -n, so that just means it's unchanged by the
command.)

Change-Id: I3046133de732c80410592272d1f7b961a64d9289
Reviewed-on: https://code.wireshark.org/review/5915
Reviewed-by: Guy Harris <guy@alum.mit.edu>
macosx-setup.sh

index bd5a6141fc601393c2f843f100691d3948e87d02..f7418af0f033612ee538ae961bafc75a83702901 100755 (executable)
@@ -443,7 +443,8 @@ fi
 
 #
 # If we have SDKs available, the default target OS is the major version
-# of the one we're running; get that and strip off the third component.
+# of the one we're running; get that and strip off the third component
+# if present.
 #
 for i in /Developer/SDKs \
     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
@@ -451,7 +452,7 @@ for i in /Developer/SDKs \
 do
     if [ -d "$i" ]
     then
-        min_osx_target=`sw_vers -productVersion | sed 's/\([[0-9]]*\).\([[0-9]]*\).[[0-9]]*/\1.\2/'`
+        min_osx_target=`sw_vers -productVersion | sed 's/\([0-9]*\)\.\([0-9]*\)\.[0-9]*/\1.\2/'`
 
         #
         # That's also the OS whose SDK we'd be using.