def _get_s2e_sources(env_path):
"""
Download the S2E manifest repository and initialize all of the S2E
repositories with repo.
"""
# Download repo
repo = _get_repo(env_path)
s2e_source_path = os.path.join(env_path, 'source', 's2e')
# Create the S2E source directory and cd to it to run repo
os.mkdir(s2e_source_path)
orig_dir = os.getcwd()
os.chdir(s2e_source_path)
git_url = CONSTANTS['repos']['url']
git_s2e_repo = CONSTANTS['repos']['s2e']
try:
# Now use repo to initialize all the repositories
logger.info('Fetching %s from %s', git_s2e_repo, git_url)
repo.init(u='%s/%s' % (git_url, git_s2e_repo), _out=sys.stdout,
_err=sys.stderr, _fg=True)
repo.sync(_out=sys.stdout, _err=sys.stderr, _fg=True)
except ErrorReturnCode as e:
# Clean up - remove the half-created S2E environment
shutil.rmtree(env_path)
raise CommandError(e)
finally:
# Change back to the original directory
os.chdir(orig_dir)
# Success!
logger.success('Fetched %s', git_s2e_repo)
评论列表
文章目录