Add package for new Portable Git version 1.9.4 to the manifest. Adjust git usage by emsdk to never install git automatically, and prefer using system-provided git if it exists. Improve instructions to guide the user to manually installing git if not found. Fixes #13.
This commit is contained in:
32
emsdk
32
emsdk
@@ -323,32 +323,30 @@ def which(program):
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
warnonce_git_not_found = False
|
# must_succeed: If false, the search is performed silently without printing out errors if not found. Empty string is returned if git is not found.
|
||||||
|
# If true, the search is required to succeed, and the execution will terminate with sys.exit(1) if not found.
|
||||||
def GIT():
|
def GIT(must_succeed=True):
|
||||||
global warnonce_git_not_found
|
# The order in the following is important, and specifies the preferred order of using the git tools.
|
||||||
git = 'git/1.8.3/bin/git.exe'
|
# Primarily use git from emsdk if installed. If not, use system git.
|
||||||
|
gits = ['git/1.9.4/bin/git.exe', which('git')]
|
||||||
|
for git in gits:
|
||||||
try:
|
try:
|
||||||
(ret, stdout, stderr) = run_get_output([git, '--version'])
|
(ret, stdout, stderr) = run_get_output([git, '--version'])
|
||||||
if ret == 0:
|
if ret == 0:
|
||||||
return git
|
return git
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
git = which('git')
|
if must_succeed:
|
||||||
try:
|
|
||||||
(ret, stdout, stderr) = run_get_output([git, '--version'])
|
|
||||||
if ret == 0:
|
|
||||||
return git
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
if not warnonce_git_not_found:
|
|
||||||
if WINDOWS:
|
if WINDOWS:
|
||||||
print "ERROR: git executable was not found. Either install git manually and add it to PATH, or install the git tool via 'emsdk install git-1.8.3'"
|
print "ERROR: git executable was not found. Please install it by typing 'emsdk install git-1.9.4', or alternatively by installing it manually from http://git-scm.com/downloads . If you install git manually, remember to add it to PATH"
|
||||||
else:
|
elif OSX:
|
||||||
print "ERROR: git executable was not found. Please install git for this operation! This can be done from http://git-scm.com/ , or by installing XCode and then the XCode Command Line Tools (see http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools )"
|
print "ERROR: git executable was not found. Please install git for this operation! This can be done from http://git-scm.com/ , or by installing XCode and then the XCode Command Line Tools (see http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools )"
|
||||||
warnonce_git_not_found = True
|
elif LINUX:
|
||||||
|
print "ERROR: git executable was not found. Please install git for this operation! This can be probably be done using your package manager, see http://git-scm.com/book/en/Getting-Started-Installing-Git"
|
||||||
|
else:
|
||||||
|
print "ERROR: git executable was not found. Please install git for this operation!"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return 'git'
|
return '' # Not found
|
||||||
|
|
||||||
def git_repo_version(repo_path):
|
def git_repo_version(repo_path):
|
||||||
(returncode, stdout, stderr) = run_get_output([GIT(), 'log', '-n', '1', '--pretty="%aD %H"'], cwd=repo_path)
|
(returncode, stdout, stderr) = run_get_output([GIT(), 'log', '-n', '1', '--pretty="%aD %H"'], cwd=repo_path)
|
||||||
|
|||||||
@@ -262,6 +262,14 @@
|
|||||||
"version": "1.8.3",
|
"version": "1.8.3",
|
||||||
"windows_url": "git_1.8.3.zip",
|
"windows_url": "git_1.8.3.zip",
|
||||||
"activated_path": "%installation_dir%/bin;%installation_dir%/cmd",
|
"activated_path": "%installation_dir%/bin;%installation_dir%/cmd",
|
||||||
|
"activated_cfg": "EMSDK_GIT='%installation_dir%'",
|
||||||
|
"is_old": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "git",
|
||||||
|
"version": "1.9.4",
|
||||||
|
"windows_url": "git_1.9.4.zip",
|
||||||
|
"activated_path": "%installation_dir%/bin;%installation_dir%/cmd",
|
||||||
"activated_cfg": "EMSDK_GIT='%installation_dir%'"
|
"activated_cfg": "EMSDK_GIT='%installation_dir%'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -462,13 +470,13 @@
|
|||||||
{
|
{
|
||||||
"version": "incoming",
|
"version": "incoming",
|
||||||
"bitness": 32,
|
"bitness": 32,
|
||||||
"uses": ["git-1.8.3", "clang-incoming-32bit", "node-0.10.17-32bit", "python-2.7.5.3-32bit", "java-7.45-32bit", "emscripten-incoming"],
|
"uses": ["clang-incoming-32bit", "node-0.10.17-32bit", "python-2.7.5.3-32bit", "java-7.45-32bit", "emscripten-incoming"],
|
||||||
"os": "win"
|
"os": "win"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "incoming",
|
"version": "incoming",
|
||||||
"bitness": 64,
|
"bitness": 64,
|
||||||
"uses": ["git-1.8.3", "clang-incoming-64bit", "node-0.10.17-64bit", "python-2.7.5.3-64bit", "java-7.45-64bit", "emscripten-incoming"],
|
"uses": ["clang-incoming-64bit", "node-0.10.17-64bit", "python-2.7.5.3-64bit", "java-7.45-64bit", "emscripten-incoming"],
|
||||||
"os": "win"
|
"os": "win"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -492,13 +500,13 @@
|
|||||||
{
|
{
|
||||||
"version": "master",
|
"version": "master",
|
||||||
"bitness": 32,
|
"bitness": 32,
|
||||||
"uses": ["git-1.8.3", "clang-master-32bit", "node-0.10.17-32bit", "python-2.7.5.3-32bit", "java-7.45-32bit", "emscripten-master"],
|
"uses": ["clang-master-32bit", "node-0.10.17-32bit", "python-2.7.5.3-32bit", "java-7.45-32bit", "emscripten-master"],
|
||||||
"os": "win"
|
"os": "win"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "master",
|
"version": "master",
|
||||||
"bitness": 64,
|
"bitness": 64,
|
||||||
"uses": ["git-1.8.3", "clang-master-64bit", "node-0.10.17-64bit", "python-2.7.5.3-64bit", "java-7.45-64bit", "emscripten-master"],
|
"uses": ["clang-master-64bit", "node-0.10.17-64bit", "python-2.7.5.3-64bit", "java-7.45-64bit", "emscripten-master"],
|
||||||
"os": "win"
|
"os": "win"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user