Skip to content
This repository
Browse code

build: fix `make install DESTDIR=/path`

Install to $DESTDIR, not $DESTDIR/$PREFIX.

Example: if DESTDIR=/opt/node, install to /opt/node, not /opt/node/usr/local.
  • Loading branch information...
commit f80513974ec525fe8e1a3aab7054af167d862d99 1 parent ff552dd
Ben Noordhuis bnoordhuis authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 tools/installer.js
10 tools/installer.js
@@ -11,7 +11,7 @@ if (cmd !== 'install' && cmd !== 'uninstall') {
11 11
12 12 // Use the built-in config reported by the current process
13 13 var variables = process.config.variables,
14   - node_prefix = variables.node_prefix || '/usr/local';
  14 + node_prefix = dest_dir || variables.node_prefix || '/usr/local';
15 15
16 16 // Execution queue
17 17 var queue = [],
@@ -27,7 +27,7 @@ function copy(src, dst, callback) {
27 27 return;
28 28 }
29 29
30   - dst = path.join(dest_dir, node_prefix, dst);
  30 + dst = path.join(node_prefix, dst);
31 31 var dir = dst.replace(/\/[^\/]*$/, '/');
32 32
33 33 // Create directory if hasn't done this yet
@@ -43,7 +43,7 @@ function copy(src, dst, callback) {
43 43 // Remove files
44 44 function remove(files) {
45 45 files.forEach(function(file) {
46   - file = path.join(dest_dir, node_prefix, file);
  46 + file = path.join(node_prefix, file);
47 47 queue.push('rm -rf ' + file);
48 48 });
49 49 }
@@ -146,9 +146,9 @@ if (cmd === 'install') {
146 146 if (!isSymlink) {
147 147 copy('deps/npm', 'lib/node_modules/npm');
148 148 queue.push('ln -sf ../lib/node_modules/npm/bin/npm-cli.js ' +
149   - path.join(dest_dir, node_prefix, 'bin/npm'));
  149 + path.join(node_prefix, 'bin/npm'));
150 150 queue.push([shebang, '#!' + path.join(node_prefix, 'bin/node'),
151   - path.join(dest_dir, node_prefix,
  151 + path.join(node_prefix,
152 152 'lib/node_modules/npm/bin/npm-cli.js')]);
153 153 }
154 154 }

0 comments on commit f805139

Please sign in to comment.
Something went wrong with that request. Please try again.