Permalink
Browse files

Revert "gzip change to support busybox"

This reverts commit dcc2f73.

Conflicts:

	lib/cache.js
  • Loading branch information...
1 parent 311df30 commit 54ff7a1c678320e22fa2bc5379b024e06d45b076 @isaacs isaacs committed Dec 9, 2010
Showing with 5 additions and 11 deletions.
  1. +5 −11 lib/cache.js
View
@@ -347,19 +347,13 @@ function unpackTar (tarball, unpackTarget, cb) {
mkdir(unpackTarget, function (er) {
if (er) return log.er(cb, "Could not create "+unpackTarget)(er)
// cp the gzip of the tarball, pipe the stdout into tar's stdin
- // gzip {tarball} -d --stdout \
- // | tar xf - -C {unpackTarget}
- var tgzReader = fs.createReadStream(tarball)
- , gzcat = spawn( npm.config.get("gzipbin")
- , ["-d", "-"] )
- sys.pump(tgzReader, gzcat.stdin)
- pipe( gzcat
+ // gzip {tarball} --decompress --stdout | tar xf - --strip-components=1 -C {unpackTarget}
+ pipe( spawn(npm.config.get("gzipbin"), ["--decompress", "--stdout", tarball])
, spawn( npm.config.get("tar")
, ["-vxpf", "-", "-C", unpackTarget]
)
, log.er(cb, "Failed unpacking the tarball.\n"
- + "This is very rare. Perhaps the 'gzipbin' or "
- + "'tar' configs\n"
+ + "This is very rare. Perhaps the 'gzip' or 'tar' configs\n"
+ "are set improperly?\n")
)
})
@@ -374,7 +368,7 @@ function packTar (targetTarball, folder, cb) {
, defaultIgnore = path.join(__dirname, "utils", "default.npmignore")
, include = path.join(folder, ".npminclude")
cb = log.er(cb, "Failed creating the tarball.\n"
- + "This is very rare. Perhaps the 'gzipbin' or 'tar' configs\n"
+ + "This is very rare. Perhaps the 'gzip' or 'tar' configs\n"
+ "are set improperly?\n")
fs.stat(ignore, function (er) {
@@ -391,7 +385,7 @@ function packTar (targetTarball, folder, cb) {
if (include) args.push("-T", include)
args.push(addFolder)
var tar = spawn(npm.config.get("tar"), args, null, false, parent)
- , gzip = spawn( npm.config.get("gzipbin"), ["-"]
+ , gzip = spawn( npm.config.get("gzipbin"), ["--stdout"]
, null, false, parent )
, errState
pipe(tar, gzip, function (er) {

0 comments on commit 54ff7a1

Please sign in to comment.