[gtk-osx] Fix XCode Version Detection on versions before 3.1



commit 0a257282056ad0162a4bbbde5b31eb88950658e6
Author: John Ralls <jralls ceridwen us>
Date:   Sun Jan 15 16:50:47 2012 -0800

    Fix XCode Version Detection on versions before 3.1
    
    Seems that before that, xcodebuild -version didn't return the first
    line, the one that starts with XCode.
    
    Just fall back to returning 3.0, since it's 4.2+ that we're worried
    about here.

 jhbuildrc-gtk-osx |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/jhbuildrc-gtk-osx b/jhbuildrc-gtk-osx
index 646e820..378d919 100644
--- a/jhbuildrc-gtk-osx
+++ b/jhbuildrc-gtk-osx
@@ -84,9 +84,14 @@ else:
     _default_arch = "i386"
 
 def xcode_ver():
-   _ver = _ver = os.popen("xcodebuild -version").read().strip()
+   ver = ver = os.popen("xcodebuild -version").read().strip()
    exp = re.compile(r'Xcode (\d.\d)')
-   return float(exp.match(_ver).group(1))
+   vernum = exp.match(ver)
+   if vernum:
+       return float(vernum.group(1))
+   else:
+       return 3.0
+
 _xcodeversion = xcode_ver()
 print _xcodeversion
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]