##// END OF EJS Templates
setup: fix mac build broken by e42d18538e1d...
Jon M. Dugan -
r13636:4bfff063 stable
parent child Browse files
Show More
@@ -121,6 +121,10 b' def runcmd(cmd, env):'
121 121 p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
122 122 stderr=subprocess.PIPE, env=env)
123 123 out, err = p.communicate()
124 return out, err
125
126 def runhg(cmd, env):
127 out, err = runcmd(cmd, env)
124 128 # If root is executing setup.py, but the repository is owned by
125 129 # another user (as in "sudo python setup.py install") we will get
126 130 # trust warnings since the .hg/hgrc file is untrusted. That is
@@ -151,7 +155,7 b" if os.path.isdir('.hg'):"
151 155 # error 0xc0150004. See: http://bugs.python.org/issue3440
152 156 env['SystemRoot'] = os.environ['SystemRoot']
153 157 cmd = [sys.executable, 'hg', 'id', '-i', '-t']
154 l = runcmd(cmd, env).split()
158 l = runhg(cmd, env).split()
155 159 while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
156 160 l.pop()
157 161 if len(l) > 1: # tag found
@@ -161,7 +165,7 b" if os.path.isdir('.hg'):"
161 165 elif len(l) == 1: # no tag found
162 166 cmd = [sys.executable, 'hg', 'parents', '--template',
163 167 '{latesttag}+{latesttagdistance}-']
164 version = runcmd(cmd, env) + l[0]
168 version = runhg(cmd, env) + l[0]
165 169 if version.endswith('+'):
166 170 version += time.strftime('%Y%m%d')
167 171 elif os.path.exists('.hg_archival.txt'):
@@ -377,7 +381,7 b" if os.name == 'nt':"
377 381 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
378 382 # XCode 4.0 dropped support for ppc architecture, which is hardcoded in
379 383 # distutils.sysconfig
380 version = runcmd(['/usr/bin/xcodebuild', '-version'], {}).splitlines()[0]
384 version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()[0]
381 385 # Also parse only first digit, because 3.2.1 can't be parsed nicely
382 386 if (version.startswith('Xcode') and
383 387 StrictVersion(version.split()[1]) >= StrictVersion('4.0')):
General Comments 0
You need to be logged in to leave comments. Login now