Skip to content

Commit db10db9

Browse files
refacktargos
authored andcommitted
build: move meta-shebang back to configure
PR-URL: #22450 Reviewed-By: Joyee Cheung <[email protected]>
1 parent db52f8f commit db10db9

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

configure

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# Locate python2 interpreter and re-execute the script. Note that the
4+
# mix of single and double quotes is intentional, as is the fact that
5+
# the ] goes on a new line.
6+
_=[ 'exec' '/bin/sh' '-c' '''
7+
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
8+
which python2 >/dev/null && exec python2 "$0" "$@"
9+
exec python "$0" "$@"
10+
''' "$0" "$@"
11+
]
12+
del _
13+
14+
import sys
15+
from distutils.spawn import find_executable as which
16+
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
17+
sys.stderr.write('Please use either Python 2.6 or 2.7')
18+
19+
python2 = which('python2') or which('python2.6') or which('python2.7')
20+
21+
if python2:
22+
sys.stderr.write(':\n\n')
23+
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))
24+
25+
sys.stderr.write('\n')
26+
sys.exit(1)
27+
28+
import configure

configure.py

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
#!/bin/sh
2-
3-
# Locate python2 interpreter and re-execute the script. Note that the
4-
# mix of single and double quotes is intentional, as is the fact that
5-
# the ] goes on a new line.
6-
_=[ 'exec' '/bin/sh' '-c' '''
7-
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
8-
which python2 >/dev/null && exec python2 "$0" "$@"
9-
exec python "$0" "$@"
10-
''' "$0" "$@"
11-
]
12-
del _
13-
141
import sys
15-
from distutils.spawn import find_executable as which
16-
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
17-
sys.stderr.write('Please use either Python 2.6 or 2.7')
18-
19-
python2 = which('python2') or which('python2.6') or which('python2.7')
20-
21-
if python2:
22-
sys.stderr.write(':\n\n')
23-
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))
24-
25-
sys.stderr.write('\n')
26-
sys.exit(1)
27-
282
import errno
293
import optparse
304
import os
@@ -35,6 +9,7 @@
359
import subprocess
3610
import shutil
3711
import string
12+
from distutils.spawn import find_executable as which
3813

3914
# If not run from node/, cd to node/.
4015
os.chdir(os.path.dirname(__file__) or '.')

0 commit comments

Comments
 (0)