From 5f0b6750e9537efb15b1ee93e46e6ad44e7e9289 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 3 Dec 2015 21:39:19 -0500 Subject: [PATCH] tools: backport tools/install.py for headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport the tools/install.py changes from 628a3ab that were missed when 6fb0b92 backported the corresponding changes to the Makefile to build the headers only archive. PR-URL: https://github.com/nodejs/node/pull/4149 Reviewed-By: Ben Noordhuis Reviewed-By: Johan Bergström Reviewed-By: Rod Vagg --- tools/install.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/install.py b/tools/install.py index 7d9024d728c9f1..9c943fa4d2574a 100755 --- a/tools/install.py +++ b/tools/install.py @@ -142,6 +142,9 @@ def files(action): if 'true' == variables.get('node_install_npm'): npm_files(action) + headers(action) + +def headers(action): action([ 'common.gypi', 'config.gypi', @@ -194,8 +197,13 @@ def run(args): install_path = dst_dir + node_prefix + '/' cmd = args[1] if len(args) > 1 else 'install' - if cmd == 'install': return files(install) - if cmd == 'uninstall': return files(uninstall) + if os.environ.get('HEADERS_ONLY'): + if cmd == 'install': return headers(install) + if cmd == 'uninstall': return headers(uninstall) + else: + if cmd == 'install': return files(install) + if cmd == 'uninstall': return files(uninstall) + raise RuntimeError('Bad command: %s\n' % cmd) if __name__ == '__main__':