From: Cheng Zhao Date: Thu, 8 Aug 2013 08:24:27 +0000 (+0800) Subject: Discard the extra node binary. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=317bd0debf6a2664d24601d938ae5ac837caa0f6;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Discard the extra node binary. We now use atom-shell's binary to execute scripts. --- diff --git a/.gitignore b/.gitignore index 88f1106..e0a60c9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ version /build/ /dist/ /frameworks/ -/node/ /out/ /vendor/brightray/vendor/download/ /vendor/python_26/ diff --git a/atom.gyp b/atom.gyp index e6d1c38..f418c43 100644 --- a/atom.gyp +++ b/atom.gyp @@ -237,13 +237,6 @@ 'browser/default_app', ], }, - { - # Copy node binary for worker process support. - 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Resources', - 'files': [ - 'node/node', - ], - }, ], 'postbuilds': [ { @@ -287,12 +280,6 @@ 'browser/default_app', ] }, - { - 'destination': '<(PRODUCT_DIR)/resources', - 'files': [ - 'node/node.exe', - ] - }, ], }], # OS=="win" ], diff --git a/script/bootstrap.py b/script/bootstrap.py index 9067af2..fb85e63 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -11,7 +11,6 @@ from lib.util import * SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor') -NODE_VERSION = 'v0.10.15' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26' @@ -22,7 +21,6 @@ def main(): args = parse_args() if not args.skip_network: update_submodules() - update_node() update_apm() update_node_modules() bootstrap_brightray(args.url) @@ -53,11 +51,6 @@ def update_submodules(): '--recursive']) -def update_node(): - un = os.path.join('script', 'update-node.py') - subprocess.check_call([sys.executable, un, '--version', NODE_VERSION]) - - def bootstrap_brightray(url): bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap') subprocess.check_call([sys.executable, bootstrap, url]) diff --git a/script/compile-coffee.py b/script/compile-coffee.py index 24e7dcf..7dd3de3 100755 --- a/script/compile-coffee.py +++ b/script/compile-coffee.py @@ -14,10 +14,9 @@ def main(): input_file = sys.argv[1] output_dir = os.path.dirname(sys.argv[2]) - node = get_node_path() coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin', 'coffee') - subprocess.check_call([node, coffee, '-c', '-o', output_dir, input_file]) + subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file]) if __name__ == '__main__': diff --git a/script/lib/util.py b/script/lib/util.py index 8b1c473..88f6b7c 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -87,10 +87,3 @@ def safe_mkdir(path): except OSError as e: if e.errno != errno.EEXIST: raise - - -def get_node_path(): - node = os.path.join(os.path.dirname(__file__), '..', '..', 'node', 'node') - if sys.platform == 'win32' or sys.platform == 'cygwin': - node += '.exe' - return node diff --git a/script/update-node.py b/script/update-node.py deleted file mode 100755 index 3da4a2c..0000000 --- a/script/update-node.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -import argparse -import errno -import subprocess -import stat -import sys -import os - -from lib.util import * - - -SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -NODE_VERSION = 'v0.10.15' -NODE_DIST_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/node/dist' -IS_POSIX = (sys.platform != 'win32') and (sys.platform != 'cygwin') - - -def main(): - os.chdir(SOURCE_ROOT) - - args = parse_args() - if not node_needs_update(args.version): - return 0 - - url, filename = get_node_url(args.url, args.version) - directory = tempdir(prefix='atom-shell-') - node_path = os.path.join(directory, filename) - download('Download node', url, node_path) - - if IS_POSIX: - root_name = 'node-{0}-{1}-x86'.format(args.version, sys.platform) - member = os.path.join(root_name, 'bin', 'node') - extract_tarball(node_path, member, directory) - node_path = os.path.join(directory, member) - - copy_node(node_path) - - -def parse_args(): - parser = argparse.ArgumentParser(description='Update node binary') - parser.add_argument('--version', - help='Version of node', - default=NODE_VERSION, - required=False) - parser.add_argument('--url', - help='URL to download node', - default=NODE_DIST_URL, - required=False) - return parser.parse_args() - - -def node_needs_update(target_version): - try: - node = os.path.join('node', 'node') - if not IS_POSIX: - node += '.exe' - version = subprocess.check_output([node, '--version']) - return version.strip() != target_version - except OSError as e: - if e.errno != errno.ENOENT: - raise - return True - - -def get_node_url(base_url, target_version): - if IS_POSIX: - distname = 'node-{0}-{1}-x86.tar.gz'.format(target_version, sys.platform) - else: - distname = 'node.exe' - return '{0}/{1}/{2}'.format(base_url, target_version, distname), distname - - -def copy_node(node_path): - safe_mkdir('node') - node = os.path.join('node', 'node') - if not IS_POSIX: - node += '.exe' - safe_unlink(node) - os.rename(node_path, node) - - st = os.stat(node) - os.chmod(node, st.st_mode | stat.S_IEXEC) - - -if __name__ == '__main__': - sys.exit(main())