addPlacedTarball: send package data obj, not name

This commit is contained in:
isaacs
2014-05-14 22:11:29 -07:00
parent e4f26ef195
commit a14aeb9a7d

View File

@@ -81,11 +81,13 @@ function addLocalTarball (p, pkgData, shasum, cb_) {
})
}
function addPlacedTarball (p, name, shasum, cb) {
if (!cb) cb = name, name = ""
function addPlacedTarball (p, pkgData, shasum, cb) {
assert(pkgData, "should have package data by now")
assert(typeof cb === "function", "cb function required")
getCacheStat(function (er, cs) {
if (er) return cb(er)
return addPlacedTarball_(p, name, cs.uid, cs.gid, shasum, cb)
return addPlacedTarball_(p, pkgData, cs.uid, cs.gid, shasum, cb)
})
}
@@ -122,7 +124,7 @@ function addPlacedTarball (p, name, shasum, cb) {
// When the tar and shasum streams both finish, make sure that the shasum
// matches dist.shasum, and if not, clean up and bail.
function addPlacedTarball_ (p, name, uid, gid, resolvedSum, cb) {
function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) {
// now we know it's in place already as .cache/name/ver/package.tgz
// unpack to .cache/name/ver/package/, read the package.json,
// and fire cb with the json data.