From 28ab7b0e75916aec3f0f2ec129d43d0bb78b9ad7 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 c8316b92ca1548..f9613f3df0dfd7 100755 --- a/tools/install.py +++ b/tools/install.py @@ -139,6 +139,9 @@ def files(action): if 'true' == variables.get('node_install_npm'): npm_files(action) + headers(action) + +def headers(action): action([ 'common.gypi', 'config.gypi', @@ -183,8 +186,13 @@ def run(args): if len(args) > 2: dst_dir = abspath(args[2] + '/' + dst_dir) 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__':