Socket
Socket
Sign inDemoInstall

node-gyp

Package Overview
Dependencies
29
Maintainers
2
Versions
144
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.4 to 0.5.5

2

bin/node-gyp.js

@@ -64,3 +64,3 @@ #!/usr/bin/env node

completed = true
log.info('done', 'ok')
log.info('ok')
return

@@ -67,0 +67,0 @@ }

@@ -9,2 +9,3 @@

var fs = require('graceful-fs')
, rm = require('rimraf')
, path = require('path')

@@ -220,5 +221,45 @@ , glob = require('glob')

}
//symlinkNodeBinding()
callback()
}
function symlinkNodeBinding () {
var buildDir = path.join('build', buildType, '*.node')
log.verbose('globbing for files', buildDir)
glob(buildDir, function (err, nodeFiles) {
if (err) return callback(err)
function link () {
var file = nodeFiles.shift()
if (!file) {
// no more files to link... done!
return callback()
}
var dest = path.join('build', path.basename(file))
log.info('symlink', 'creating link %j pointing to %j', file, dest)
var rel = path.relative('build', file)
log.verbose('symlink data', rel)
fs.symlink(rel, dest, 'file', function (err) {
if (err) {
if (err.code === 'EEXIST') {
log.verbose('destination already exists; deleting', dest)
rm(dest, function (err) {
if (err) return callback(err)
log.verbose('delete successful; trying symlink again')
nodeFiles.unshift(file)
link()
})
} else {
callback(err)
}
return
}
// process the next file, if any
link()
})
}
// start linking
link()
})
}
}

@@ -44,3 +44,3 @@

var versionStr = argv[0] || gyp.opts.target || process.version
log.verbose('install', 'input version string', versionStr)
log.verbose('install', 'input version string %j', versionStr)

@@ -61,7 +61,12 @@ // parse the version to normalize and ensure it's valid

// 0.x.y-pre versions are not published yet. Use previous release.
// 0.x.y-pre versions are not published yet and cannot be installed. Bail.
if (version[5] === '-pre') {
version[3] = +version[3] - 1
version[5] = null
log.verbose('-pre version detected, adjusting patch version')
log.verbose('detected "pre" node version', versionStr)
if (gyp.opts.nodedir) {
log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir)
callback()
} else {
callback(new Error('"pre" versions of node cannot be installed, use the --nodedir flag instead'))
}
return
}

@@ -112,3 +117,3 @@

function download (url, onError) {
function download (url) {
log.http('GET', url)

@@ -118,3 +123,2 @@

uri: url
, onResponse: true
}

@@ -131,3 +135,3 @@

}
var req = request(requestOpts, onError)
var req = request(requestOpts)
req.on('response', function (res) {

@@ -182,13 +186,19 @@ log.http(res.statusCode, url)

// download the tarball, gunzip and extract!
var req = download(tarballUrl, downloadError)
.pipe(gunzip)
.pipe(extracter)
var req = download(tarballUrl)
// something went wrong downloading the tarball?
function downloadError (err, res) {
if (err || res.statusCode != 200) {
req.on('error', function (err) {
badDownload = true
cb(err)
})
req.on('response', function (res) {
if (res.statusCode !== 200) {
badDownload = true
cb(err || new Error(res.statusCode + ' status code downloading tarball'))
cb(new Error(res.statusCode + ' status code downloading tarball'))
return
}
}
// start unzipping and untaring
req.pipe(gunzip).pipe(extracter)
})

@@ -282,3 +292,8 @@ // invoked after the tarball has finished being extracted

done(new Error(res.statusCode + ' status code downloading 32-bit node.lib'))
return
}
var ws = fs.createWriteStream(nodeLibPath32)
ws.on('error', cb)
req.pipe(ws)
})

@@ -288,6 +303,2 @@ req.on('end', function () {

})
var ws = fs.createWriteStream(nodeLibPath32)
ws.on('error', cb)
req.pipe(ws)
})

@@ -303,3 +314,8 @@ mkdir(dir64, function (err) {

done(new Error(res.statusCode + ' status code downloading 64-bit node.lib'))
return
}
var ws = fs.createWriteStream(nodeLibPath64)
ws.on('error', cb)
req.pipe(ws)
})

@@ -309,6 +325,2 @@ req.on('end', function () {

})
var ws = fs.createWriteStream(nodeLibPath64)
ws.on('error', cb)
req.pipe(ws)
})

@@ -315,0 +327,0 @@ }

{ "name": "node-gyp"
, "description": "Node.js native addon build tool"
, "keywords": [ "native", "addon", "module", "c", "c++", "bindings", "gyp" ]
, "version": "0.5.4"
, "version": "0.5.5"
, "installVersion": 9

@@ -6,0 +6,0 @@ , "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc