Prepare for a potential "0.10" release.

We can no longer treat the version like a Number, since `0.10`
gets represented as `0.1`.
This commit is contained in:
Nathan Rajlich 2012-02-11 17:08:50 -08:00
parent 58b0abe4fe
commit 2461ff762c
4 changed files with 51 additions and 13 deletions

View file

@ -8,6 +8,7 @@ module.exports = exports = configure
var fs = require('fs')
, path = require('path')
, glob = require('glob')
, nodeVersion = require('./util/node_version')
, win = process.platform == 'win32'
exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module'
@ -20,11 +21,11 @@ function configure (gyp, argv, callback) {
if (gyp.opts.target) {
// if --target was given, then ensure that version is installed
version = parseFloat(gyp.opts.target)
version = nodeVersion.parse(gyp.opts.target)
gyp.verbose('compiling against --target node version', version)
} else {
// if no --target was specified then use the current host node version
version = parseFloat(process.versions.node)
version = nodeVersion.parse(process.versions.node)
gyp.verbose('no --target version specified, falling back to host node version', version)
}
gyp.opts.ensure = true
@ -67,7 +68,7 @@ function configure (gyp, argv, callback) {
, devDir = path.join(process.env.HOME, '.node-gyp', target)
, gyp_addon = path.join(devDir, 'tools', 'gyp_addon')
if (win && version < 0.8) {
if (win && nodeVersion.lessThan(version, 0, 8)) {
gyp.verbose('on Windows and target version is less than 0.8; applying #2685 patch')
// if < 0.8, we need to manually apply the patch at joyent/node#2685,
// since it got merged somewhere in 0.7.x.
@ -76,7 +77,7 @@ function configure (gyp, argv, callback) {
argv.push(path.join(devDir, 'tools', 'patch.gypi'))
}
if (!win && version < 0.8) {
if (!win && nodeVersion.lessThan(version, 0, 8)) {
gyp.verbose('on Unix and target version is less than 0.8; applying #2722 patch')
argv.push('-I')
argv.push(path.join(devDir, 'tools', 'patch2722.gypi'))