patch-deps_npm_lib_build_js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. $OpenBSD: patch-deps_npm_lib_build_js,v 1.3 2017/01/23 16:47:04 abieber Exp $
  2. --- deps/npm/lib/build.js.orig Thu Nov 3 08:07:29 2016
  3. +++ deps/npm/lib/build.js Thu Nov 3 08:11:47 2016
  4. @@ -203,17 +203,23 @@ function linkBins (pkg, folder, parent, gtop, cb) {
  5. // bins should always be executable.
  6. // XXX skip chmod on windows?
  7. var src = path.resolve(folder, pkg.bin[b])
  8. - fs.chmod(src, npm.modes.exec, function (er) {
  9. - if (er && er.code === 'ENOENT' && npm.config.get('ignore-scripts')) {
  10. - return cb()
  11. + fs.lstat(folder, function (er,stat) {
  12. + if (!stat.isSymbolicLink) {
  13. + fs.chmod(src, npm.modes.exec, function (er) {
  14. + if (er && er.code === "ENOENT" && npm.config.get("ignore-scripts")) {
  15. + return cb()
  16. + }
  17. + if (er || !gtop) return cb(er)
  18. + var dest = path.resolve(binRoot, b)
  19. + , out = npm.config.get("parseable")
  20. + ? dest + "::" + src + ":BINFILE"
  21. + : dest + " -> " + src
  22. + console.log(out)
  23. + cb()
  24. + })
  25. + } else {
  26. + cb()
  27. }
  28. - if (er || !gtop) return cb(er)
  29. - var dest = path.resolve(binRoot, b)
  30. - var out = npm.config.get('parseable')
  31. - ? dest + '::' + src + ':BINFILE'
  32. - : dest + ' -> ' + src
  33. - output(out)
  34. - cb()
  35. })
  36. }
  37. )