You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-db/mongodb/files/mongodb-1.8.5-fix-smokepy.p...

25 lines
1.2 KiB

--- a/SConstruct 2012-08-20 10:26:51.484835418 +0200
+++ b/SConstruct 2012-08-20 10:27:49.855374497 +0200
@@ -765,11 +765,16 @@
binaries = ['python', 'python2.5', 'python2.6', 'python2.7', 'python25', 'python26', 'python27']
for binary in binaries:
try:
- # py-2.4 compatible replacement for shell backticks
- output = subprocess.Popen([binary, '--version'], stdout=subprocess.PIPE).communicate()[0]
- match = version.search(output)
- if match and float(match.group(1)) >= 2.5:
- return binary
+ for path in smokeEnv['ENV']['PATH'].split(':'):
+ if os.path.isfile( '%s/%s' % (path, binary) ):
+ # py-2.4 compatible replacement for shell backticks
+ out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ for stream in (out, err):
+ match = version.search(stream)
+ if match:
+ versiontuple = tuple(map(int, match.group(1).split('.')))
+ if versiontuple >= (2, 5):
+ return binary
except:
pass