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>
#
# 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 \
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.