Permalink
Browse files

Add proprietary-attribs config, default to false for npm itself, true…

… otherwise
  • Loading branch information...
isaacs committed Nov 30, 2011
1 parent 26102ed commit cf45d7f3fb692be73b951029662fbb23d737f6b5
Showing with 22 additions and 2 deletions.
  1. +12 −0 doc/cli/config.md
  2. +2 −0 lib/utils/config-defs.js
  3. +7 −1 lib/utils/tar.js
  4. +1 −1 package.json
View
@@ -474,6 +474,18 @@ Set to true to run in "production" mode.
local `npm install` without any arguments.
2. Set the NODE_ENV="production" for lifecycle scripts.
+### proprietary-attribs
+
+* Default: true
+* Type: Boolea
+
+Whether or not to include proprietary extended attributes in the
+tarballs created by npm.
+
+Unless you are expecting to unpack package tarballs with something other
+than npm -- particularly a very outdated tar implementation -- leave
+this as true.
+
### proxy
* Default: `HTTP_PROXY` or `http_proxy` environment variable, or null
View
@@ -168,6 +168,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, pre: false
, prefix : globalPrefix
, production: false
+ , "proprietary-attribs": true
, proxy : process.env.HTTP_PROXY || process.env.http_proxy || null
, "https-proxy" : process.env.HTTPS_PROXY || process.env.https_proxy ||
process.env.HTTP_PROXY || process.env.http_proxy || null
@@ -241,6 +242,7 @@ exports.types =
, pre: Boolean
, prefix: path
, production: Boolean
+ , "proprietary-attribs": Boolean
, proxy : [null, url]
, "rebuild-bundle" : Boolean
, registry : [null, url]
View
@@ -45,6 +45,7 @@ function pack (targetTarball, folder, pkg, dfc, cb) {
log.silly(folder, "makeList")
makeList(folder, pkg, dfc, function (er, files, cleanup) {
if (er) return cb(er)
+ // log.silly(files, "files")
return packFiles(targetTarball, parent, files, pkg, function (er) {
if (!cleanup || !cleanup.length) return cb(er)
// try to be a good citizen, even/especially in the event of failure.
@@ -91,7 +92,12 @@ function packFiles (targetTarball, parent, files, pkg, cb_) {
}
})
.on("error", log.er(cb, "error reading "+parent))
- .pipe(tar.Pack())
+ // By default, npm includes some proprietary attributes in the
+ // package tarball. This is sane, and allowed by the spec.
+ // However, npm *itself* excludes these from its own package,
+ // so that it can be more easily bootstrapped using old and
+ // non-compliant tar implementations.
+ .pipe(tar.Pack({ noProprietary: !npm.config.get("proprietary-attribs") }))
.on("error", log.er(cb, "tar creation error "+targetTarball))
.pipe(zlib.Gzip())
.on("error", log.er(cb, "gzip error "+targetTarball))
View
@@ -1,5 +1,5 @@
{ "name": "npm"
-, "publishConfig": { "tag": "alpha" }
+, "publishConfig": { "tag": "alpha", "proprietary-attribs": false }
, "description": "A package manager for node"
, "keywords": [ "package manager", "modules", "install", "package.json" ]
, "version": "1.1.0-alpha-2"

0 comments on commit cf45d7f

Please sign in to comment.