Skip to content

Instantly share code, notes, and snippets.

@qbit
Created May 1, 2011 16:06
Show Gist options
  • Save qbit/950607 to your computer and use it in GitHub Desktop.
Save qbit/950607 to your computer and use it in GitHub Desktop.
openbsd npm install fix
diff --git a/lib/utils/tar.js b/lib/utils/tar.js
index 8c5bf94..ffa4ac1 100644
--- a/lib/utils/tar.js
+++ b/lib/utils/tar.js
@@ -167,11 +167,18 @@ function gunzTarPerm (tarball, tmp, dMode, fMode, uid, gid, cb) {
//console.error(npm.config.get("gzipbin")+" --decompress --stdout "
// +tarball+" | "+npm.config.get("tar")+" -mvxpf - --no-same-owner -C "
// +tmp)
+ var os = require("os");
+ var opts = [ "-mvxpf", "-", "--no-same-owner", "-C", tmp];
+
+ if ( os.type() === 'OpenBSD' ) {
+ opts = [ "-mvxpf", "-", "-C", tmp];
+ }
+
pipe( spawn( npm.config.get("gzipbin")
, ["--decompress", "--stdout", tarball]
, process.env, false )
, spawn( npm.config.get("tar")
- , ["-mvxpf", "-", "--no-same-owner", "-C", tmp]
+ , opts
, process.env, false )
, function (er) {
// if we're not doing ownership management,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment