diff options
author | isaacs <i@izs.me> | 2014-05-15 09:11:29 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-05-15 09:11:29 +0400 |
commit | a14aeb9a7d09f49fecefa9eebb0b9a49a514b7ab (patch) | |
tree | 30c812e524222be0c521426b0d9b7f90bd44070b /lib | |
parent | e4f26ef1959e59418f1e22ecd31a500ec92e7995 (diff) |
addPlacedTarball: send package data obj, not name
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache/add-local-tarball.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/cache/add-local-tarball.js b/lib/cache/add-local-tarball.js index 7a65b7080..6c724bb78 100644 --- a/lib/cache/add-local-tarball.js +++ b/lib/cache/add-local-tarball.js @@ -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. |