128 lines
4.4 KiB
Diff
128 lines
4.4 KiB
Diff
From ec4c67b9b2c7f6a0e04d7ba86c39d50fbd9607d2 Mon Sep 17 00:00:00 2001
|
|
From: mati865 <mati865@gmail.com>
|
|
Date: Sun, 4 Sep 2016 18:44:50 +0200
|
|
Subject: [PATCH 09/13] Revert to FHS installation paths on Windows (tests not
|
|
fixed)
|
|
|
|
---
|
|
deps/npm/bin/npm | 4 ++--
|
|
deps/npm/bin/npm.cmd | 4 ++--
|
|
deps/npm/lib/build.js | 2 +-
|
|
deps/npm/lib/config/defaults.js | 7 ++-----
|
|
deps/npm/lib/npm.js | 6 ++----
|
|
deps/npm/lib/unbuild.js | 1 -
|
|
6 files changed, 9 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/deps/npm/bin/npm b/deps/npm/bin/npm
|
|
index 5acd6fb..dc01687 100644
|
|
--- a/deps/npm/bin/npm
|
|
+++ b/deps/npm/bin/npm
|
|
@@ -12,12 +12,12 @@ if ! [ -x "$NODE_EXE" ]; then
|
|
NODE_EXE=node
|
|
fi
|
|
|
|
-NPM_CLI_JS="$basedir/node_modules/npm/bin/npm-cli.js"
|
|
+NPM_CLI_JS="$basedir/../lib/node_modules/npm/bin/npm-cli.js"
|
|
|
|
case `uname` in
|
|
*MINGW*)
|
|
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
|
|
- NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js"
|
|
+ NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/../lib/node_modules/npm/bin/npm-cli.js"
|
|
if [ -f "$NPM_PREFIX_NPM_CLI_JS" ]; then
|
|
NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS"
|
|
fi
|
|
diff --git a/deps/npm/bin/npm.cmd b/deps/npm/bin/npm.cmd
|
|
index 880554d..12507ba 100644
|
|
--- a/deps/npm/bin/npm.cmd
|
|
+++ b/deps/npm/bin/npm.cmd
|
|
@@ -8,9 +8,9 @@ IF NOT EXIST "%NODE_EXE%" (
|
|
SET "NODE_EXE=node"
|
|
)
|
|
|
|
-SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
|
|
+SET "NPM_CLI_JS=%~dp0\..\lib\node_modules\npm\bin\npm-cli.js"
|
|
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO (
|
|
- SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js"
|
|
+ SET "NPM_PREFIX_NPM_CLI_JS=%%F\..\lib\node_modules\npm\bin\npm-cli.js"
|
|
)
|
|
IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" (
|
|
SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%"
|
|
diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js
|
|
index fbe78c7..202da86 100644
|
|
--- a/deps/npm/lib/build.js
|
|
+++ b/deps/npm/lib/build.js
|
|
@@ -229,7 +229,7 @@ function linkBin (from, to, gently, cb) {
|
|
}
|
|
|
|
function linkMans (pkg, folder, parent, gtop, cb) {
|
|
- if (!pkg.man || !gtop || process.platform === 'win32') return cb()
|
|
+ if (!pkg.man || !gtop) return cb()
|
|
|
|
var manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man')
|
|
log.verbose('linkMans', 'man files are', pkg.man, 'in', manRoot)
|
|
diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js
|
|
index e93c1e5..b1a16d0 100644
|
|
--- a/deps/npm/lib/config/defaults.js
|
|
+++ b/deps/npm/lib/config/defaults.js
|
|
@@ -81,8 +81,8 @@ var uidOrPid = process.getuid ? process.getuid() : process.pid
|
|
if (home) process.env.HOME = home
|
|
else home = path.resolve(temp, 'npm-' + uidOrPid)
|
|
|
|
-var cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm'
|
|
-var cacheRoot = process.platform === 'win32' && process.env.APPDATA || home
|
|
+var cacheExtra = '.npm'
|
|
+var cacheRoot = home
|
|
var cache = path.resolve(cacheRoot, cacheExtra)
|
|
|
|
var globalPrefix
|
|
@@ -91,9 +91,6 @@ Object.defineProperty(exports, 'defaults', {get: function () {
|
|
|
|
if (process.env.PREFIX) {
|
|
globalPrefix = process.env.PREFIX
|
|
- } else if (process.platform === 'win32') {
|
|
- // c:\node\node.exe --> prefix=c:\node\
|
|
- globalPrefix = path.dirname(process.execPath)
|
|
} else {
|
|
// /usr/local/bin/node --> prefix=/usr/local
|
|
globalPrefix = path.dirname(path.dirname(process.execPath))
|
|
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
|
|
index 4f81015..b84e818 100644
|
|
--- a/deps/npm/lib/npm.js
|
|
+++ b/deps/npm/lib/npm.js
|
|
@@ -332,7 +332,7 @@
|
|
{
|
|
get: function () {
|
|
var b = npm.globalPrefix
|
|
- if (process.platform !== 'win32') b = path.resolve(b, 'bin')
|
|
+ b = path.resolve(b, 'bin')
|
|
return b
|
|
}
|
|
})
|
|
@@ -349,9 +349,7 @@
|
|
Object.defineProperty(npm, 'globalDir',
|
|
{
|
|
get: function () {
|
|
- return (process.platform !== 'win32')
|
|
- ? path.resolve(npm.globalPrefix, 'lib', 'node_modules')
|
|
- : path.resolve(npm.globalPrefix, 'node_modules')
|
|
+ return path.resolve(npm.globalPrefix, 'lib', 'node_modules')
|
|
},
|
|
enumerable: true
|
|
})
|
|
diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js
|
|
index 9ba5972..1915a5f 100644
|
|
--- a/deps/npm/lib/unbuild.js
|
|
+++ b/deps/npm/lib/unbuild.js
|
|
@@ -90,7 +90,6 @@ function rmBins (pkg, folder, parent, top, cb) {
|
|
function rmMans (pkg, folder, parent, top, cb) {
|
|
if (!pkg.man ||
|
|
!top ||
|
|
- process.platform === 'win32' ||
|
|
!npm.config.get('global')) {
|
|
return cb()
|
|
}
|
|
--
|
|
2.9.1
|
|
|