Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't pack files as read-only

  • Loading branch information...
commit 26102ed3c5ddfaca548257d3c1acf8494ab0220a 1 parent 2633057
@isaacs isaacs authored
Showing with 15 additions and 2 deletions.
  1. +15 −2 lib/utils/tar.js
View
17 lib/utils/tar.js
@@ -59,7 +59,7 @@ function pack (targetTarball, folder, pkg, dfc, cb) {
})
}
-function packFiles (targetTarball, parent, files, pkg, cb) {
+function packFiles (targetTarball, parent, files, pkg, cb_) {
var p
@@ -70,11 +70,23 @@ function packFiles (targetTarball, parent, files, pkg, cb) {
parent = path.resolve(parent, p)
+ var called = false
+ function cb (er) {
+ if (called) return
+ called = true
+ cb_(er)
+ }
+
log.verbose(targetTarball, "tarball")
log.verbose(parent, "parent")
fstream.Reader({ type: "Directory"
, path: parent
, filter: function () {
+ // files should *always* get into tarballs
+ // in a user-writable state, even if they're
+ // being installed from some wackey vm-mounted
+ // read-only filesystem.
+ this.props.mode = this.props.mode | 0200
return -1 !== files.indexOf(this.path)
}
})
@@ -276,7 +288,8 @@ function makeList (dir, pkg, dfc, cb) {
makeList_(dir, pkg, exList, dfc, function (er, files, cleanup) {
if (er) return cb(er)
- var dirLen = dir.length + 1
+ var dirLen = dir.replace(/(\/|\\)$/, "").length + 1
+ log.silly([dir, dirLen], "dir, dirLen")
files = files.map(function (file) {
return path.join(name, file.substr(dirLen))
})
Please sign in to comment.
Something went wrong with that request. Please try again.