Skip to content

Commit dd7d7ad

Browse files
committed
Merge remote-tracking branch 'origin/nw12'
2 parents 1b34250 + 4edc16a commit dd7d7ad

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
0.12.0 / 03-05-2015
22
=======================
33
- Chromium updated to 41.0.2272.76
4-
- [Screen Selection] OSX and Win implementation (Thanks to Jefry <jefry.ted@vcube.co.jp>)
4+
- [Screen Selection] OSX and Win implementation (Thanks to Jefry)
55
- Fix #3165: crash on auth in webview
66

77
0.12.0-rc1 / 02-27-2015

tools/make-nw-headers.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
import distutils.core
88
import re
99

10+
def update_uvh(tmp_dir, header_files):
11+
for file in header_files:
12+
header_f = os.path.join(tmp_dir, 'node', 'src', file)
13+
rfile = open(header_f, 'r')
14+
old = rfile.read()
15+
new = re.sub('third_party/node/deps/uv/include/uv.h', 'uv.h', old, 0)
16+
wfile = open(header_f, 'w')
17+
wfile.write(new)
18+
wfile.close()
19+
return
20+
1021
script_dir = os.path.dirname(__file__)
1122
nw_root = os.path.normpath(os.path.join(script_dir, os.pardir))
1223
project_root = os.path.normpath(os.path.join(nw_root, os.pardir, os.pardir))
@@ -21,7 +32,7 @@
2132
'''
2233
if '-t' in sys.argv:
2334
nw_version = sys.argv[sys.argv.index('-t') + 1]
24-
tarname = 'node-v' + nw_version + '.tar.gz'
35+
tarname = 'nw-headers-v' + nw_version + '.tar.gz'
2536
tarpath = os.path.join(tmp_dir, tarname)
2637

2738
#make tmpdir
@@ -71,21 +82,13 @@
7182
if os.path.exists(os.path.join(tmp_dir, 'node', 'deps', 'npm', 'node_modules')):
7283
shutil.rmtree(os.path.join(tmp_dir, 'node', 'deps', 'npm', 'node_modules'))
7384

74-
rfile = open(os.path.join(tmp_dir, 'node', 'src', 'node.h'), 'r')
75-
filer = rfile.read()
76-
sub = re.sub('third_party/node/deps/uv/include/uv.h', 'uv.h', filer, 0)
77-
rfile.close()
78-
wfile = open(os.path.join(tmp_dir, 'node', 'src', 'node.h'), 'w')
79-
wfile.write(sub)
80-
wfile.close()
85+
header_files = ['node.h', 'env.h', 'env-inl.h']
86+
update_uvh(tmp_dir, header_files)
8187

8288
print 'copy file end'
8389
print 'Begin compress file'
8490

85-
tar = tarfile.open(tarpath, 'w:gz')
86-
for dirpath, dirnames, filenames in os.walk(tmp_dir):
87-
for name in filenames:
88-
path = os.path.normpath(os.path.join(dirpath, name))
89-
tar.add(path, path.replace(tmp_dir + os.sep, ''))
90-
tar.close()
91-
print 'compress end'
91+
with tarfile.open(tarpath, 'w:gz') as tar:
92+
tar.add(os.path.join(tmp_dir, 'node'), arcname='node')
93+
94+
print 'compress end'

0 commit comments

Comments
 (0)