allow to autofetch dependencies
This commit is contained in:
parent
f3ee4aba6f
commit
8b8e95521f
19
update.py
19
update.py
@ -267,13 +267,15 @@ def fetch_modules(config, relative_path):
|
|||||||
parse_doc = False
|
parse_doc = False
|
||||||
if parse_doc:
|
if parse_doc:
|
||||||
with open(file_name, 'r') as f:
|
with open(file_name, 'r') as f:
|
||||||
config_docopt, config_define, config_export = parse_cmake_module(f.read())
|
config_docopt, config_define, config_export, config_fetch = parse_cmake_module(f.read())
|
||||||
if config_docopt:
|
if config_docopt:
|
||||||
config.set(section, 'docopt', config_docopt)
|
config.set(section, 'docopt', config_docopt)
|
||||||
if config_define:
|
if config_define:
|
||||||
config.set(section, 'define', config_define)
|
config.set(section, 'define', config_define)
|
||||||
if config_export:
|
if config_export:
|
||||||
config.set(section, 'export', config_export)
|
config.set(section, 'export', config_export)
|
||||||
|
if config_fetch:
|
||||||
|
config.set(section, 'fetch', config_fetch)
|
||||||
modules.append(Module(path=path, name=name))
|
modules.append(Module(path=path, name=name))
|
||||||
i += 1
|
i += 1
|
||||||
print_progress_bar(
|
print_progress_bar(
|
||||||
@ -282,6 +284,10 @@ def fetch_modules(config, relative_path):
|
|||||||
total=n,
|
total=n,
|
||||||
width=30
|
width=30
|
||||||
)
|
)
|
||||||
|
if config.has_option(section, 'fetch'):
|
||||||
|
for src in config.get(section, 'fetch').split('\n'):
|
||||||
|
dst = os.path.join(download_directory, os.path.basename(src))
|
||||||
|
fetch_url(src, dst)
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
return modules
|
return modules
|
||||||
@ -365,9 +371,10 @@ def parse_cmake_module(s_in):
|
|||||||
config_docopt = None
|
config_docopt = None
|
||||||
config_define = None
|
config_define = None
|
||||||
config_export = None
|
config_export = None
|
||||||
|
config_fetch = None
|
||||||
|
|
||||||
if 'autocmake.cfg configuration::' not in s_in:
|
if 'autocmake.cfg configuration::' not in s_in:
|
||||||
return config_docopt, config_define, config_export
|
return config_docopt, config_define, config_export, config_fetch
|
||||||
|
|
||||||
s_out = []
|
s_out = []
|
||||||
is_rst_line = False
|
is_rst_line = False
|
||||||
@ -400,8 +407,10 @@ def parse_cmake_module(s_in):
|
|||||||
config_define = config.get(section, 'define')
|
config_define = config.get(section, 'define')
|
||||||
if config.has_option(section, 'export'):
|
if config.has_option(section, 'export'):
|
||||||
config_export = config.get(section, 'export')
|
config_export = config.get(section, 'export')
|
||||||
|
if config.has_option(section, 'fetch'):
|
||||||
|
config_fetch = config.get(section, 'fetch')
|
||||||
|
|
||||||
return config_docopt, config_define, config_export
|
return config_docopt, config_define, config_export, config_fetch
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -425,7 +434,7 @@ if(NOT DEFINED CMAKE_C_COMPILER_ID)
|
|||||||
message(FATAL_ERROR "CMAKE_C_COMPILER_ID variable is not defined!")
|
message(FATAL_ERROR "CMAKE_C_COMPILER_ID variable is not defined!")
|
||||||
endif()'''
|
endif()'''
|
||||||
|
|
||||||
config_docopt, config_define, config_export = parse_cmake_module(s)
|
config_docopt, config_define, config_export, config_fetch = parse_cmake_module(s)
|
||||||
|
|
||||||
assert config_docopt == "--cxx=<CXX> C++ compiler [default: g++].\n--extra-cxx-flags=<EXTRA_CXXFLAGS> Extra C++ compiler flags [default: '']."
|
assert config_docopt == "--cxx=<CXX> C++ compiler [default: g++].\n--extra-cxx-flags=<EXTRA_CXXFLAGS> Extra C++ compiler flags [default: '']."
|
||||||
|
|
||||||
@ -441,7 +450,7 @@ if(NOT DEFINED CMAKE_C_COMPILER_ID)
|
|||||||
message(FATAL_ERROR "CMAKE_C_COMPILER_ID variable is not defined!")
|
message(FATAL_ERROR "CMAKE_C_COMPILER_ID variable is not defined!")
|
||||||
endif()'''
|
endif()'''
|
||||||
|
|
||||||
config_docopt, config_define, config_export = parse_cmake_module(s)
|
config_docopt, config_define, config_export, config_fetch = parse_cmake_module(s)
|
||||||
|
|
||||||
assert config_docopt is None
|
assert config_docopt is None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user