[DEBUG] add some correction
This commit is contained in:
parent
76b9b883ee
commit
28cd4ef882
@ -37,6 +37,8 @@ encoding//lutin/z_system/lutinSystem_Linux_m.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_mysql.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_opengl.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_pthread.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_python3-numpy.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_python3.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_rt.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_Linux_z.py=utf-8
|
||||
encoding//lutin/z_system/lutinSystem_MacOs_Cocoa.py=utf-8
|
||||
@ -48,6 +50,7 @@ encoding//lutin/z_system/lutinSystem_Windows_start-mode-gui.py=utf-8
|
||||
encoding//lutin/z_target/lutinTarget_Android.py=utf-8
|
||||
encoding//lutin/z_target/lutinTarget_Debian.py=utf-8
|
||||
encoding//lutin/z_target/lutinTarget_IOs.py=utf-8
|
||||
encoding//lutin/z_target/lutinTarget_Linux.py=utf-8
|
||||
encoding//lutin/z_target/lutinTarget_MacOs.py=utf-8
|
||||
encoding//lutin/z_target/lutinTarget_Windows.py=utf-8
|
||||
encoding//lutin/zip.py=utf-8
|
||||
|
@ -129,7 +129,8 @@ def usage(full=False):
|
||||
"""
|
||||
|
||||
print(data_print)
|
||||
if mod["description"] != "":
|
||||
if mod["description"] != None \
|
||||
and mod["description"] != "":
|
||||
print(" " + mod["description"])
|
||||
if full == True:
|
||||
if mod["type"] != None \
|
||||
|
@ -72,14 +72,14 @@ def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_id
|
||||
debug.extreme_verbose(" force_identical='" + str(force_identical) + "'")
|
||||
# if force mode selected ==> just force rebuild ...
|
||||
if env.get_force_mode():
|
||||
debug.extreme_verbose(" ==> must rebuild (force mode)")
|
||||
debug.verbose(" ==> must rebuild (force mode)")
|
||||
return True
|
||||
|
||||
# check if the destination existed:
|
||||
if dst != "" \
|
||||
and dst != None \
|
||||
and os.path.exists(dst) == False:
|
||||
debug.extreme_verbose(" ==> must rebuild (dst does not exist)")
|
||||
debug.verbose(" ==> must rebuild (dst does not exist)")
|
||||
return True
|
||||
if src != "" \
|
||||
and src != None \
|
||||
@ -92,25 +92,25 @@ def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_id
|
||||
and src != "" \
|
||||
and src != None \
|
||||
and os.path.getmtime(src) > os.path.getmtime(dst):
|
||||
debug.extreme_verbose(" ==> must rebuild (source time greater)")
|
||||
debug.verbose(" ==> must rebuild (source time greater)")
|
||||
return True
|
||||
|
||||
if depend_file != "" \
|
||||
and depend_file != None \
|
||||
and os.path.exists(depend_file) == False:
|
||||
debug.extreme_verbose(" ==> must rebuild (no depending file)")
|
||||
debug.verbose(" ==> must rebuild (no depending file)")
|
||||
return True
|
||||
|
||||
if file_cmd != "" \
|
||||
and file_cmd != None:
|
||||
if os.path.exists(file_cmd) == False:
|
||||
debug.extreme_verbose(" ==> must rebuild (no commandLine file)")
|
||||
debug.verbose(" ==> must rebuild (no commandLine file)")
|
||||
return True
|
||||
# check if the 2 cmd_line are similar :
|
||||
file2 = open(file_cmd, "r")
|
||||
first_and_unique_line = file2.read()
|
||||
if first_and_unique_line != cmd_line:
|
||||
debug.extreme_verbose(" ==> must rebuild (cmd_lines are not identical)")
|
||||
debug.verbose(" ==> must rebuild (cmd_lines are not identical)")
|
||||
debug.extreme_verbose(" ==> '" + cmd_line + "'")
|
||||
debug.extreme_verbose(" ==> '" + first_and_unique_line + "'")
|
||||
file2.close()
|
||||
@ -124,35 +124,37 @@ def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_id
|
||||
file = open(depend_file, "r")
|
||||
for cur_line in file.readlines():
|
||||
# normal file : end with : ": \\n"
|
||||
cur_line = cur_line[:len(cur_line)-1]
|
||||
cur_line_data = cur_line[:len(cur_line)-1]
|
||||
|
||||
# removing last \ ...
|
||||
if cur_line[len(cur_line)-1:] == '\\' :
|
||||
cur_line = cur_line[:len(cur_line)-1]
|
||||
if cur_line_data[len(cur_line_data)-1:] == '\\' :
|
||||
cur_line_data = cur_line_data[:len(cur_line_data)-1]
|
||||
# remove white space :
|
||||
#debug.verbose(" Line (read) : '" + cur_line + "'");
|
||||
cur_line = cur_line.strip()
|
||||
cur_line_data = cur_line_data.strip()
|
||||
#debug.verbose(" Line (strip) : '" + cur_line + "'");
|
||||
|
||||
test_file=""
|
||||
if cur_line[len(cur_line)-1:] == ':':
|
||||
debug.extreme_verbose(" Line (no check (already done) : '" + cur_line + "'");
|
||||
elif len(cur_line) == 0 \
|
||||
or cur_line == '\\':
|
||||
debug.extreme_verbose(" Line (Not parsed) : '" + cur_line + "'");
|
||||
else:
|
||||
test_file = cur_line
|
||||
debug.extreme_verbose(" Line (might check) : '" + test_file + "'");
|
||||
# really check files:
|
||||
if test_file != "":
|
||||
debug.extreme_verbose(" ==> test");
|
||||
if False==os.path.exists(test_file):
|
||||
debug.extreme_verbose(" ==> must rebuild (a dependency file does not exist)")
|
||||
file.close()
|
||||
return True
|
||||
if os.path.getmtime(test_file) > os.path.getmtime(dst):
|
||||
debug.extreme_verbose(" ==> must rebuild (a dependency file time is newer)")
|
||||
file.close()
|
||||
return True
|
||||
for cur_line in cur_line_data.split(" "):
|
||||
test_file=""
|
||||
if cur_line[len(cur_line)-1:] == ':':
|
||||
debug.extreme_verbose(" Line (no check (already done) : '" + cur_line + "'");
|
||||
elif len(cur_line) == 0 \
|
||||
or cur_line == '\\':
|
||||
debug.extreme_verbose(" Line (Not parsed) : '" + cur_line + "'");
|
||||
else:
|
||||
test_file = cur_line
|
||||
debug.extreme_verbose(" Line (might check) : '" + test_file + "'");
|
||||
# really check files:
|
||||
if test_file != "":
|
||||
debug.extreme_verbose(" ==> test");
|
||||
if False==os.path.exists(test_file):
|
||||
debug.verbose(" ==> must rebuild (a dependency file does not exist) " + str(test_file))
|
||||
file.close()
|
||||
return True
|
||||
if os.path.getmtime(test_file) > os.path.getmtime(dst):
|
||||
debug.verbose(" ==> must rebuild (a dependency file time is newer)" + str(test_file))
|
||||
file.close()
|
||||
return True
|
||||
# close the current file :
|
||||
file.close()
|
||||
# check the 2 files are identical:
|
||||
@ -161,12 +163,12 @@ def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_id
|
||||
size_src = _file_size(src)
|
||||
size_dst = _file_size(dst)
|
||||
if size_src != size_dst:
|
||||
debug.extreme_verbose(" Force Rewrite not the same size size_src=" + str(size_src) + " != size_dest=" + str(size_dst))
|
||||
debug.info(" Force Rewrite not the same size size_src=" + str(size_src) + " != size_dest=" + str(size_dst))
|
||||
return True
|
||||
data_src = _file_read_data(src, binary=True)
|
||||
data_dst = _file_read_data(dst, binary=True)
|
||||
if data_src != data_dst:
|
||||
debug.extreme_verbose(" Force Rewrite not the same data")
|
||||
debug.info(" Force Rewrite not the same data")
|
||||
return True
|
||||
|
||||
debug.extreme_verbose(" ==> Not rebuild (all dependency is OK)")
|
||||
|
@ -14,6 +14,7 @@ import copy
|
||||
import inspect
|
||||
import fnmatch
|
||||
import json
|
||||
import re
|
||||
# Local import
|
||||
from . import host
|
||||
from . import tools
|
||||
@ -314,13 +315,13 @@ class Module:
|
||||
image.resize(source, temporary_file, sizeX, sizeY, file_cmd)
|
||||
# Copy file in statndard mode
|
||||
tools.copy_file(temporary_file,
|
||||
os.path.join(target.get_build_path_data(self._name), destination),
|
||||
os.path.join(target.get_build_path_data(self._name, group="in-shared"), destination),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
else:
|
||||
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
|
||||
tools.copy_file(source,
|
||||
os.path.join(target.get_build_path_data(self._name), destination),
|
||||
os.path.join(target.get_build_path_data(self._name, group="in-shared"), destination),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
|
||||
@ -332,7 +333,7 @@ class Module:
|
||||
## @return None
|
||||
##
|
||||
def files_to_build(self, target, copy_list):
|
||||
for source, destination in self._files:
|
||||
for source, destination, group in self._files:
|
||||
display_source = source
|
||||
source = os.path.join(self._origin_path, source)
|
||||
if destination == "":
|
||||
@ -340,9 +341,9 @@ class Module:
|
||||
debug.verbose("Regenerate Destination : '" + destination + "'")
|
||||
# TODO : set it back : file_cmd = target.get_build_path_data(self.name)
|
||||
file_cmd = ""
|
||||
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
|
||||
debug.warning("Might copy file : " + display_source + "==> (" + str(group) + ") " + destination)
|
||||
tools.copy_file(source,
|
||||
os.path.join(target.get_build_path_data(self._name), destination),
|
||||
os.path.join(target.get_build_path_data(self._name, group=group_folder), destination),
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
|
||||
@ -354,8 +355,8 @@ class Module:
|
||||
## @return None
|
||||
##
|
||||
def paths_to_build(self, target, copy_list):
|
||||
for source, destination in self._paths:
|
||||
debug.debug("Might copy path : " + source + "==>" + destination)
|
||||
for source, destination, group in self._paths:
|
||||
debug.warning("Might copy path : " + source + "==> (" + str(group) + ") " + destination)
|
||||
tmp_path = os.path.dirname(os.path.realpath(os.path.join(self._origin_path, source)))
|
||||
tmp_rule = os.path.basename(source)
|
||||
for root, dirnames, filenames in os.walk(tmp_path):
|
||||
@ -374,10 +375,10 @@ class Module:
|
||||
# TODO : maybe an error when changing subdirectory ...
|
||||
#if root[len(source)-1:] != "":
|
||||
# new_destination = os.path.join(new_destination, root[len(source)-1:])
|
||||
debug.verbose("Might copy : '" + os.path.join(root, cycle_file) + "' ==> '" + os.path.join(target.get_build_path_data(self._name), new_destination, cycle_file) + "'" )
|
||||
debug.verbose("Might copy : '" + os.path.join(root, cycle_file) + "' ==> '" + os.path.join(target.get_build_path_data(self._name, group=group), new_destination, cycle_file) + "'" )
|
||||
file_cmd = "" # TODO : ...
|
||||
tools.copy_file(os.path.join(root, cycle_file),
|
||||
os.path.join(target.get_build_path_data(self._name), new_destination, cycle_file),
|
||||
os.path.join(target.get_build_path_data(self._name, group=group), new_destination, cycle_file),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
|
||||
@ -729,12 +730,12 @@ class Module:
|
||||
and self._type != 'PACKAGE':
|
||||
# build local sources in a specific order:
|
||||
for builder_name in self._ordered_builder:
|
||||
debug.warning("Execute builder : " + builder_name);
|
||||
debug.verbose("Execute builder : " + builder_name);
|
||||
if builder_name not in self._src.keys():
|
||||
debug.warning(" ==> nothing to do...");
|
||||
debug.verbose(" ==> nothing to do...");
|
||||
continue;
|
||||
for file in self._src[builder_name]:
|
||||
debug.info(" " + self._name + " <== " + file);
|
||||
debug.verbose(" " + self._name + " <== " + file);
|
||||
fileExt = file.split(".")[-1]
|
||||
try:
|
||||
tmp_builder = builder.get_builder_named(builder_name);
|
||||
@ -962,7 +963,8 @@ class Module:
|
||||
#real copy files
|
||||
tools.copy_list(copy_list)
|
||||
# remove unneded files (NOT folder ...)
|
||||
tools.clean_directory(target.get_build_path_data(self._name), copy_list)
|
||||
tools.clean_directory(target.get_build_path_data(self._name, group = "in-shared"), copy_list)
|
||||
tools.clean_directory(target.get_build_path_data(self._name, group = "in-bin"), copy_list)
|
||||
|
||||
# create local heritage specification
|
||||
self._local_heritage.auto_add_build_header()
|
||||
@ -1269,7 +1271,9 @@ class Module:
|
||||
##
|
||||
## @return None
|
||||
##
|
||||
def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False, builder_name="*"):
|
||||
def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False, builder_name=None):
|
||||
if builder_name == None:
|
||||
builder_name = "*";
|
||||
if destination_path != None:
|
||||
debug.verbose("Change destination PATH: '" + str(destination_path) + "'")
|
||||
new_list = []
|
||||
@ -1335,12 +1339,12 @@ class Module:
|
||||
## @param[in] destination_path (string) Path to install the files (remove all the path of the file)
|
||||
## @return None
|
||||
##
|
||||
def add_header_path(self, base_path, regex="*", clip_path=None, recursive=False, destination_path=None):
|
||||
def add_header_path(self, base_path, regex="*", clip_path=None, recursive=False, destination_path=None, builder_name=None):
|
||||
if base_path[-1] == '/' \
|
||||
or base_path[-1] == '\\':
|
||||
self.add_header_file(base_path + regex, clip_path=clip_path, recursive=recursive, destination_path=destination_path)
|
||||
self.add_header_file(base_path + regex, clip_path=clip_path, recursive=recursive, destination_path=destination_path, builder_name=builder_name)
|
||||
else:
|
||||
self.add_header_file(base_path + "/" + regex, clip_path=clip_path, recursive=recursive, destination_path=destination_path)
|
||||
self.add_header_file(base_path + "/" + regex, clip_path=clip_path, recursive=recursive, destination_path=destination_path, builder_name=builder_name)
|
||||
##
|
||||
## @brief Many library need to generate dynamic data file, use this to add dynamic generated files
|
||||
## @param[in] self (handle) Class handle
|
||||
@ -1422,8 +1426,11 @@ class Module:
|
||||
## @param[in] destination (string) Destination path to install data
|
||||
## @return None
|
||||
##
|
||||
def copy_file(self, source, destination=''):
|
||||
self._files.append([source, destination])
|
||||
def copy_file(self, source, destination='', group_folder="in-shared"):
|
||||
groups = ["in-shared", "in-bin"];
|
||||
if group_folder not in groups:
|
||||
debug.error("Can not add file in other group than " + str(groups) + " but require: " + str(group_folder))
|
||||
self._files.append([source, destination, group_folder])
|
||||
|
||||
##
|
||||
## @brief Copy the path in the module datas
|
||||
@ -1432,8 +1439,11 @@ class Module:
|
||||
## @param[in] destination (string) Destination path to install data
|
||||
## @return None
|
||||
##
|
||||
def copy_path(self, source, destination=''):
|
||||
self._paths.append([source, destination])
|
||||
def copy_path(self, source, destination='', group_folder="in-shared"):
|
||||
groups = ["in-shared", "in-bin"];
|
||||
if group_folder not in groups:
|
||||
debug.error("Can not add file in other group than " + str(groups) + " but require: " + str(group_folder))
|
||||
self._paths.append([source, destination, group_folder])
|
||||
|
||||
##
|
||||
## @brief Print the list to help
|
||||
@ -1806,8 +1816,11 @@ def import_path(path_list):
|
||||
def exist(target, name):
|
||||
global __module_list
|
||||
for mod in __module_list:
|
||||
if mod[0] == name:
|
||||
return True
|
||||
return_check = bool(re.match(name, mod[0]));
|
||||
debug.warning("check exist: " + name + " => " + mod[0]);
|
||||
#if mod[0] == name:
|
||||
if return_check:
|
||||
return True;
|
||||
return False
|
||||
|
||||
##
|
||||
@ -1816,10 +1829,15 @@ def exist(target, name):
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (handle) @ref Module handle
|
||||
##
|
||||
def load_module(target, name):
|
||||
def load_module(target, name_reg):
|
||||
global __module_list
|
||||
#debug.warning("Load module: " + str(len(__module_list)) + " => " + str(__module_list));
|
||||
for mod in __module_list:
|
||||
if mod[0] == name:
|
||||
return_check = bool(re.match(name_reg, mod[0]));
|
||||
debug.warning("check load: " + name_reg + " => " + mod[0]);
|
||||
#if mod[0] == name :
|
||||
if return_check:
|
||||
name = mod[0]
|
||||
if mod[2]== False:
|
||||
# read GLD file
|
||||
the_module = moduleGLD.load_module_from_GLD(target, mod[0], os.path.dirname(mod[1]), mod[1])
|
||||
|
@ -424,6 +424,47 @@ def parse_node_flag(target, path, json_path, my_module, data, export = False):
|
||||
else:
|
||||
debug.error("not manage list of flag other than string and list of string, but it is " + str(type(data[elem])) + " in: '" + str(json_path) + "' for: " + str(data));
|
||||
|
||||
def parse_node_header_dict(target, path, json_path, my_module, data, builder_name = None):
|
||||
if "path" in data.keys() or "to" in data.keys() or "recursive" in data.keys() or "filter" in data.keys():
|
||||
#{'path': 'thirdparty/src/', 'filter': '*.h', 'to': 'g3log'}
|
||||
elem_path = "";
|
||||
elem_to = "";
|
||||
elem_recursive = True;
|
||||
elem_filter = "*"
|
||||
if "path" in data:
|
||||
elem_path = data["path"];
|
||||
if "to" in data:
|
||||
elem_to = data["to"];
|
||||
if "recursive" in data:
|
||||
elem_recursive = data["recursive"];
|
||||
if "filter" in data:
|
||||
elem_filter = data["filter"];
|
||||
if elem_path == "":
|
||||
debug.error("header does not support type of dict: " + str(data) + " ==> missing 'path'")
|
||||
my_module.add_header_path(elem_path, regex=elem_filter, clip_path=None, recursive=elem_recursive, destination_path=elem_to, builder_name=builder_name);
|
||||
else:
|
||||
for builder_key in data.keys():
|
||||
my_module.add_header_file(data[builder_key], builder_name=builder_key);
|
||||
|
||||
def parse_node_header_list(target, path, json_path, my_module, data, builder_name = None):
|
||||
for elem in data:
|
||||
if type(elem) == list or type(elem) == str:
|
||||
my_module.add_header_file(elem, builder_name = builder_name);
|
||||
elif type(elem) == dict:
|
||||
parse_node_header_dict(target, path, json_path, my_module, elem, builder_name);
|
||||
else:
|
||||
debug.error("headers does not manage other than string, list and object");
|
||||
|
||||
def parse_node_header(target, path, json_path, my_module, data, builder_name = None):
|
||||
if type(data) == str:
|
||||
my_module.add_header_file(data, builder_name = builder_name);
|
||||
if type(data) == list:
|
||||
parse_node_header_list(target, path, json_path, my_module, data, builder_name);
|
||||
elif type(data) == dict:
|
||||
parse_node_header_dict(target, path, json_path, my_module, data, builder_name);
|
||||
else:
|
||||
debug.error("Wrong type for node 'headers' [] or {}");
|
||||
|
||||
def parse_node_generic(target, path, json_path, my_module, data, first = False ):
|
||||
for elem in data.keys():
|
||||
if elem in list_of_property_module:
|
||||
@ -450,37 +491,7 @@ def parse_node_generic(target, path, json_path, my_module, data, first = False )
|
||||
debug.error("'" + json_path + "'Wrong type for node 'source' [] or {} or string");
|
||||
|
||||
if "header" in data.keys():
|
||||
if type(data["header"]) == list:
|
||||
for elem in data["header"]:
|
||||
if type(elem) == list:
|
||||
my_module.add_header_file(elem);
|
||||
elif type(elem) == str:
|
||||
my_module.add_header_file(elem);
|
||||
elif type(elem) == dict:
|
||||
pass;
|
||||
#{'path': 'thirdparty/src/', 'filter': '*.h', 'to': 'g3log'}
|
||||
elem_path = "";
|
||||
elem_to = "";
|
||||
elem_recursive = True;
|
||||
elem_filter = "*"
|
||||
if "path" in elem:
|
||||
elem_path = elem["path"];
|
||||
if "to" in elem:
|
||||
elem_to = elem["to"];
|
||||
if "recursive" in elem:
|
||||
elem_recursive = elem["recursive"];
|
||||
if "filter" in elem:
|
||||
elem_filter = elem["filter"];
|
||||
if elem_path == "":
|
||||
debug.error("header does not support type of dict: " + str(elem) + " ==> missing 'path'")
|
||||
my_module.add_header_path(elem_path, regex=elem_filter, clip_path=None, recursive=elem_recursive, destination_path=elem_to);
|
||||
else:
|
||||
debug.error("headers does not manage other than string, list and object");
|
||||
elif type(data["header"]) == dict:
|
||||
for builder_key in data["header"].keys():
|
||||
my_module.add_header_file(data["header"][builder_key], builder_name=builder_key);
|
||||
else:
|
||||
debug.error("Wrong type for node 'headers' [] or {}");
|
||||
parse_node_header(target, path, json_path, my_module, data["header"]);
|
||||
|
||||
if "path" in data.keys():
|
||||
if type(data["path"]) == list:
|
||||
@ -657,9 +668,12 @@ def GLD_copy(my_module, data):
|
||||
path_src = None;
|
||||
file_src = None;
|
||||
path_to = "";
|
||||
group_folder = "in-shared";
|
||||
recursive = False;
|
||||
if "path" in data.keys():
|
||||
path_src = data["path"];
|
||||
if "group" in data.keys():
|
||||
group_folder = data["group"];
|
||||
if "file" in data.keys():
|
||||
file_src = data["file"];
|
||||
if "to" in data.keys():
|
||||
@ -672,11 +686,11 @@ def GLD_copy(my_module, data):
|
||||
if path_src == None and file_src == None:
|
||||
debug.error("copy must at least have 'path' or 'file' !!!");
|
||||
if path_src != None:
|
||||
my_module.copy_path(path_src, path_to);
|
||||
my_module.copy_path(path_src, path_to, group_folder=group_folder);
|
||||
if file_src != None:
|
||||
my_module.copy_file(file_src, path_to);
|
||||
my_module.copy_file(file_src, path_to, group_folder=group_folder);
|
||||
elif type(data) == str:
|
||||
my_module.copy_file(data, "");
|
||||
my_module.copy_file(data, "", group_folder=group_folder);
|
||||
else:
|
||||
debug.error("in module : " + my_module.get_name() + " not supported type for copy: " + type(data) + " string or object data=" + str(data));
|
||||
except Exception as e:
|
||||
|
@ -61,6 +61,30 @@ def run_command_no_lock_out(cmd_line):
|
||||
# launch the subprocess:
|
||||
p.communicate()
|
||||
|
||||
|
||||
def run_command_pwd(cmd_line, cwd):
|
||||
# prepare command line:
|
||||
args = shlex.split(cmd_line)
|
||||
debug.verbose("cmd = " + str(args))
|
||||
try:
|
||||
# create the subprocess
|
||||
"""
|
||||
if cwd != None:
|
||||
debug.info("path = " + cwd)
|
||||
"""
|
||||
p = subprocess.Popen(args, cwd=cwd);
|
||||
except subprocess.CalledProcessError as e:
|
||||
debug.error("subprocess.CalledProcessError : " + str(args))
|
||||
except Exception as eee:
|
||||
debug.warning("On : " + str(args))
|
||||
debug.error("Exception: " + str(eee))
|
||||
except:
|
||||
print("Unexpected error:", sys.exc_info()[0])
|
||||
raise
|
||||
p.communicate();
|
||||
# Check error :
|
||||
return p.returncode
|
||||
|
||||
##
|
||||
## @brief Execute the command and ruturn generate data
|
||||
##
|
||||
|
@ -144,6 +144,8 @@ class Target:
|
||||
self.path_bin="bin"
|
||||
self.path_lib="lib"
|
||||
self.path_data="share"
|
||||
self.path_data_in_shared="data_share"
|
||||
self.path_data_in_bin="data_bin"
|
||||
self.path_doc="doc"
|
||||
self.path_include="include"
|
||||
self.path_temporary_generate="generate"
|
||||
@ -444,10 +446,15 @@ class Target:
|
||||
## @brief Get the data path where pre-write the install "data" files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @param[in] group (enum [in-bin, in-shared]) Group of the destination
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_data(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_data, name)
|
||||
def get_build_path_data(self, name, group):
|
||||
if group == "in-shared":
|
||||
return os.path.join(self.get_build_path(name), self.path_data_in_shared, name)
|
||||
elif group == "in-bin":
|
||||
return os.path.join(self.get_build_path(name), self.path_data_in_bin, name)
|
||||
debug.error("wrong type (impossible case...)")
|
||||
|
||||
##
|
||||
## @brief Get the include path where pre-install "include" headers files
|
||||
@ -519,10 +526,15 @@ class Target:
|
||||
## @brief Get the data path for staging step
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the package
|
||||
## @param[in] group (enum [in-bin, in-shared]) Group of the destination
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_data(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_data, name)
|
||||
def get_staging_path_data(self, name, tmp=False, group = "in-shared"):
|
||||
if group == "in-shared":
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_data, name)
|
||||
elif group == "in-bin":
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_bin, name)
|
||||
debug.error("wrong type (impossible case...)")
|
||||
|
||||
##
|
||||
## @brief Get the include path for staging step
|
||||
@ -730,7 +742,7 @@ class Target:
|
||||
"""
|
||||
if mod.get_type() != "BINARY" \
|
||||
and mod.get_type() != "PACKAGE":
|
||||
debug.error("Can not run other than 'BINARY' ... pakage='" + mod.get_type() + "' for module='" + module_name + "'")
|
||||
debug.error("Can not run other than 'BINARY' ... package='" + mod.get_type() + "' for module='" + module_name + "'")
|
||||
"""
|
||||
bin_name = None
|
||||
if len(action_name) > 3:
|
||||
@ -769,8 +781,9 @@ class Target:
|
||||
and optionnal == True:
|
||||
ret = [heritage.HeritageList(), False]
|
||||
else:
|
||||
debug.warning("compare " + str(self.module_list) + " " + module_name)
|
||||
for mod in self.module_list:
|
||||
debug.verbose("compare " + mod.get_name() + " == " + module_name)
|
||||
debug.warning("compare " + mod.get_name() + " == " + module_name)
|
||||
if mod.get_name() == module_name:
|
||||
if action_name[:4] == "dump":
|
||||
debug.info("dump module '" + module_name + "'")
|
||||
@ -899,7 +912,7 @@ class Target:
|
||||
debug.debug("heritage for " + str(pkg_name) + ":")
|
||||
for heritage in heritage_list.list_heritage:
|
||||
debug.debug("sub elements: " + str(heritage.name))
|
||||
path_src = self.get_build_path_data(heritage.name)
|
||||
path_src = self.get_build_path_data(heritage.name, group="in-shared")
|
||||
debug.verbose(" has directory: " + path_src)
|
||||
if os.path.isdir(path_src):
|
||||
if static == True:
|
||||
@ -991,6 +1004,29 @@ class Target:
|
||||
except:
|
||||
debug.extreme_verbose("can not find : " + path_src)
|
||||
pass
|
||||
# copy data for the data inside bin (stupid, but needed)
|
||||
debug.debug("heritage for " + str(pkg_name) + ":")
|
||||
for heritage in heritage_list.list_heritage:
|
||||
debug.debug("sub elements: " + str(heritage.name))
|
||||
path_src = self.get_build_path_data(heritage.name, group="in-bin")
|
||||
if os.path.isdir(path_src):
|
||||
if static == True:
|
||||
debug.debug(" need copy: " + path_src + " to " + path_package_bin)
|
||||
#copy all data:
|
||||
tools.copy_anything(path_src,
|
||||
path_package_bin,
|
||||
recursive=True,
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
else:
|
||||
debug.debug(" need copy: " + os.path.dirname(path_src) + " to " + path_package_bin)
|
||||
#copy all data:
|
||||
tools.copy_anything(os.path.dirname(path_src),
|
||||
path_package_bin,
|
||||
recursive=True,
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
|
||||
#real copy files
|
||||
ret_copy = tools.copy_list(copy_list)
|
||||
ret_remove = False
|
||||
|
@ -24,7 +24,7 @@ class System(system.System):
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "icuuc")
|
||||
self.add_flag("link-lib", "icui18n")
|
||||
self.add_flag("link-lib", "icuData")
|
||||
self.add_flag("link-lib", "icudata")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
|
@ -165,14 +165,17 @@ class Target(target.Target):
|
||||
def run(self, pkg_name, option_list, binary_name = None):
|
||||
if binary_name == None:
|
||||
binary_name = pkg_name;
|
||||
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", "bin")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' executable: '" + binary_name + "' + option: " + str(option_list))
|
||||
debug.info("-- Run path (PWD) '" + str(appl_path))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
appl_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", "bin", binary_name)
|
||||
cmd = appl_path + " "
|
||||
cmd = os.path.join(appl_path, binary_name) + " ";
|
||||
for elem in option_list:
|
||||
cmd += elem + " "
|
||||
multiprocess.run_command_no_lock_out(cmd)
|
||||
cmd += elem + " ";
|
||||
ret = multiprocess.run_command_pwd(cmd, appl_path);
|
||||
if ret != 0:
|
||||
debug.error("application exit with error: " + str(ret));
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' Finished")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
|
Loading…
x
Reference in New Issue
Block a user