From 1e895bdf76372f5da7707773ccdeb942a633f21e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 21 Aug 2013 12:09:26 +0800 Subject: [PATCH] Create the tarball containing node's headers. --- script/create-dist.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 3d4a616..9e6b55b 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -6,6 +6,7 @@ import os import shutil import subprocess import sys +import tarfile from lib.util import * @@ -13,7 +14,8 @@ from lib.util import * SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node') -DIST_HEADERS_DIR = os.path.join(DIST_DIR, 'node-{0}'.format(get_atom_shell_version())) +DIST_HEADERS_NAME = 'node-{0}'.format(get_atom_shell_version()) +DIST_HEADERS_DIR = os.path.join(DIST_DIR, DIST_HEADERS_NAME) BUNDLE_NAME = 'Atom.app' BUNDLE_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release', BUNDLE_NAME) @@ -39,12 +41,13 @@ def main(): rm_rf(DIST_DIR) os.makedirs(DIST_DIR) - force_build() - copy_binaries() + # force_build() + # copy_binaries() copy_headers() copy_license() create_version() - create_zip() + # create_zip() + create_header_tarball() def force_build(): @@ -92,6 +95,13 @@ def create_zip(): subprocess.check_call(['zip', '-r', '-y', zip_file] + files) +def create_header_tarball(): + with scoped_cwd(DIST_DIR): + tarball = tarfile.open(name=DIST_HEADERS_DIR + '.tar.gz', mode='w:gz') + tarball.add(DIST_HEADERS_NAME) + tarball.close() + + def copy_source_file(source): relative = os.path.relpath(source, start=NODE_DIR) destination = os.path.join(DIST_HEADERS_DIR, relative) -- 2.7.4