diff options
author | isaacs <i@izs.me> | 2012-07-11 04:13:49 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-07-11 04:13:49 +0400 |
commit | f8cbb5154a5a3ae6b7326ef6600a9f6ff8572c16 (patch) | |
tree | da39020c1e30d62f347e88b4a25954c8a68b684b /node_modules/node-gyp/lib/configure.js | |
parent | c61ec1d7d79aa5ad69538a20e51ede15e6fd715a (diff) |
node-gyp: Upgrade to 0.5.8
Diffstat (limited to 'node_modules/node-gyp/lib/configure.js')
-rw-r--r-- | node_modules/node-gyp/lib/configure.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js index 1cdd32037..3dbd41879 100644 --- a/node_modules/node-gyp/lib/configure.js +++ b/node_modules/node-gyp/lib/configure.js @@ -47,7 +47,7 @@ function configure (gyp, argv, callback) { // We're gonna glob C:\python2* function guessPython () { log.verbose('could not find "' + python + '". guessing location') - var rootDir = process.env.HOMEDRIVE || process.env.SystemDrive || 'C:\\' + var rootDir = process.env.SystemDrive || 'C:\\' if (rootDir[rootDir.length - 1] !== '\\') { rootDir += '\\' } @@ -72,11 +72,21 @@ function configure (gyp, argv, callback) { if (err) { return callback(err) } + log.verbose('check python version', '`python --version` returned: %j', stderr) var version = stderr.trim().replace(/[^\d\.]+/g, '') - if (semver.lt(version, '3.0.0')) { + var numDots = 0 + version.replace(/\./g, function () { + numDots++ + }) + while (numDots < 2) { + version += '.0' + numDots++ + } + log.verbose('check python version', 'using version %j to check', version) + if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) { getNodeDir() } else { - failPython3() + failPythonVersion(version) } }) } @@ -86,10 +96,10 @@ function configure (gyp, argv, callback) { + '", you can set the PYTHON env variable.')) } - function failPython3 () { + function failPythonVersion (badVersion) { callback(new Error('Python executable "' + python - + '" is Python 3, which is not supported.\n' - + 'You can set the PYTHON env variable to point to a Python 2 interpreter.')) + + '" is v' + badVersion + ', which is not supported by gyp.\n' + + 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.')) } function getNodeDir () { |