Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-12-09 05:12:49 +0300
committerisaacs <i@izs.me>2010-12-09 05:12:49 +0300
commit54ff7a1c678320e22fa2bc5379b024e06d45b076 (patch)
treec17d5a84cba3681a596e0249b2ed8200006dc56e
parent311df30583b3819b0514b09539b0afa5dd363ae7 (diff)
Revert "gzip change to support busybox"
This reverts commit dcc2f738062e3824680630abd73c081279f82823. Conflicts: lib/cache.js
-rw-r--r--lib/cache.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/cache.js b/lib/cache.js
index 3a5cc6cd2..e056e7e79 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -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) {