Obtain SHA-1 of libcc commit from submodule

This commit is contained in:
Kevin Sawicki 2017-05-22 09:27:32 -07:00
parent 433a827cc3
commit 77ec648740
3 changed files with 18 additions and 9 deletions

View file

@ -3,12 +3,13 @@
import argparse
import errno
import os
import re
import subprocess
import sys
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
enable_verbose_mode, is_verbose_mode, get_target_arch
from lib.util import execute_stdout, get_electron_version, scoped_cwd
from lib.config import BASE_URL, PLATFORM, enable_verbose_mode, \
is_verbose_mode, get_target_arch
from lib.util import execute, execute_stdout, get_electron_version, scoped_cwd
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@ -143,8 +144,8 @@ def setup_libchromiumcontent(is_dev, target_arch, url,
target_dir = os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')
download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script',
'download')
args = ['-f', '-c', LIBCHROMIUMCONTENT_COMMIT, '--target_arch', target_arch,
url, target_dir]
args = ['-f', '-c', get_libchromiumcontent_commit(), '--target_arch',
target_arch, url, target_dir]
if (libcc_source_path != None and
libcc_shared_library_path != None and
libcc_static_library_path != None):
@ -275,6 +276,17 @@ def create_node_headers():
'--version', get_electron_version()])
def get_libchromiumcontent_commit():
commit = os.getenv('LIBCHROMIUMCONTENT_COMMIT')
if commit:
return commit
# Extract full SHA-1 of libcc submodule commit
output = execute(['git', 'submodule', 'status', 'vendor/libchromiumcontent'])
commit = re.split('^(?:\s*)([a-f0-9]{40})(?:\s+)', output)[1]
return commit
def mkdir_p(path):
try:
os.makedirs(path)

View file

@ -9,8 +9,7 @@ import subprocess
import sys
import stat
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
get_target_arch, get_zip_name
from lib.config import BASE_URL, PLATFORM, get_target_arch, get_zip_name
from lib.util import scoped_cwd, rm_rf, get_electron_version, make_zip, \
execute, electron_gyp

View file

@ -8,8 +8,6 @@ import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \
'a3cff052273b659702c6a8728e28a3b45659cd76'
PLATFORM = {
'cygwin': 'win32',