build: move meta-shebang back to configure
PR-URL: https://github.com/nodejs/node/pull/22450 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
parent
d1c5d18ff6
commit
cc9dd0f365
28
configure
vendored
Executable file
28
configure
vendored
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Locate python2 interpreter and re-execute the script. Note that the
|
||||||
|
# mix of single and double quotes is intentional, as is the fact that
|
||||||
|
# the ] goes on a new line.
|
||||||
|
_=[ 'exec' '/bin/sh' '-c' '''
|
||||||
|
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
|
||||||
|
which python2 >/dev/null && exec python2 "$0" "$@"
|
||||||
|
exec python "$0" "$@"
|
||||||
|
''' "$0" "$@"
|
||||||
|
]
|
||||||
|
del _
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from distutils.spawn import find_executable as which
|
||||||
|
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
|
||||||
|
sys.stderr.write('Please use either Python 2.6 or 2.7')
|
||||||
|
|
||||||
|
python2 = which('python2') or which('python2.6') or which('python2.7')
|
||||||
|
|
||||||
|
if python2:
|
||||||
|
sys.stderr.write(':\n\n')
|
||||||
|
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))
|
||||||
|
|
||||||
|
sys.stderr.write('\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
import configure
|
27
configure.py
27
configure.py
@ -1,30 +1,4 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Locate python2 interpreter and re-execute the script. Note that the
|
|
||||||
# mix of single and double quotes is intentional, as is the fact that
|
|
||||||
# the ] goes on a new line.
|
|
||||||
_=[ 'exec' '/bin/sh' '-c' '''
|
|
||||||
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
|
|
||||||
which python2 >/dev/null && exec python2 "$0" "$@"
|
|
||||||
exec python "$0" "$@"
|
|
||||||
''' "$0" "$@"
|
|
||||||
]
|
|
||||||
del _
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from distutils.spawn import find_executable as which
|
|
||||||
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
|
|
||||||
sys.stderr.write('Please use either Python 2.6 or 2.7')
|
|
||||||
|
|
||||||
python2 = which('python2') or which('python2.6') or which('python2.7')
|
|
||||||
|
|
||||||
if python2:
|
|
||||||
sys.stderr.write(':\n\n')
|
|
||||||
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))
|
|
||||||
|
|
||||||
sys.stderr.write('\n')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
@ -35,6 +9,7 @@ import shlex
|
|||||||
import subprocess
|
import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
|
from distutils.spawn import find_executable as which
|
||||||
|
|
||||||
# If not run from node/, cd to node/.
|
# If not run from node/, cd to node/.
|
||||||
os.chdir(os.path.dirname(__file__) or '.')
|
os.chdir(os.path.dirname(__file__) or '.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user