[DEV] upgrade to support multiple run test and chach at the end only (add suport of gnuc++ on GLB (bad hook)
This commit is contained in:
parent
1604b08af7
commit
88834cc4d0
@ -30,9 +30,12 @@ encoding//lutin/z_system/lutinSystem_Android_m.py=utf-8
|
|||||||
encoding//lutin/z_system/lutinSystem_IOs_c.py=utf-8
|
encoding//lutin/z_system/lutinSystem_IOs_c.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_IOs_cxx.py=utf-8
|
encoding//lutin/z_system/lutinSystem_IOs_cxx.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_alsa.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Linux_alsa.py=utf-8
|
||||||
|
encoding//lutin/z_system/lutinSystem_Linux_bsd.py=utf-8
|
||||||
|
encoding//lutin/z_system/lutinSystem_Linux_bz2.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_c.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Linux_c.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_cxx.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Linux_cxx.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_egl.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Linux_egl.py=utf-8
|
||||||
|
encoding//lutin/z_system/lutinSystem_Linux_gnutls.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_khr.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Linux_khr.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_m.py=utf-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_mysql.py=utf-8
|
||||||
@ -41,6 +44,7 @@ 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-numpy.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_python3.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_rt.py=utf-8
|
||||||
|
encoding//lutin/z_system/lutinSystem_Linux_sodium.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Linux_z.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Linux_z.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_MacOs_Cocoa.py=utf-8
|
encoding//lutin/z_system/lutinSystem_MacOs_Cocoa.py=utf-8
|
||||||
encoding//lutin/z_system/lutinSystem_Windows_ole.py=utf-8
|
encoding//lutin/z_system/lutinSystem_Windows_ole.py=utf-8
|
||||||
|
169
bin/lutin
169
bin/lutin
@ -41,6 +41,7 @@ myArgs.add("o", "force-optimisation", desc="Force optimisation of the build")
|
|||||||
myArgs.add("w", "warning", desc="Store warning in a file build file")
|
myArgs.add("w", "warning", desc="Store warning in a file build file")
|
||||||
myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c and c++ system lib to not include unneeded external libs) EXPERIMENTAL (archlinux)")
|
myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c and c++ system lib to not include unneeded external libs) EXPERIMENTAL (archlinux)")
|
||||||
myArgs.add("K", "ccache", desc="Enable the ccache interface")
|
myArgs.add("K", "ccache", desc="Enable the ccache interface")
|
||||||
|
myArgs.add("A", "async-fail", desc="Asynchronous fail of all the run execution, this permit to execute all test and report all fails")
|
||||||
|
|
||||||
myArgs.add_section("properties", "keep in the sequency of the cible")
|
myArgs.add_section("properties", "keep in the sequency of the cible")
|
||||||
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
|
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
|
||||||
@ -62,27 +63,29 @@ localArgument = myArgs.parse()
|
|||||||
display the help of this makefile
|
display the help of this makefile
|
||||||
"""
|
"""
|
||||||
def usage(full=False):
|
def usage(full=False):
|
||||||
color = debug.get_color_set()
|
color = debug.get_color_set();
|
||||||
# generic argument displayed :
|
# generic argument displayed :
|
||||||
myArgs.display()
|
myArgs.display();
|
||||||
print(" All target can finish with '?clean' '?dump' '?gcov' ... ?action (@ can replace ?)" )
|
print(" All target can finish with '?clean' '?dump' '?gcov' ... ?action (@ can replace ?)" );
|
||||||
print(" " + color['green'] + "all" + color['default'])
|
print(" " + color['green'] + "all" + color['default']);
|
||||||
print(" build all (only for the current selected board) (bynary and packages)")
|
print(" build all (only for the current selected board) (bynary and packages)");
|
||||||
print(" " + color['green'] + "clean" + color['default'])
|
print(" " + color['green'] + "clean" + color['default']);
|
||||||
print(" clean all (same as previous)")
|
print(" clean all (same as previous)");
|
||||||
print(" " + color['green'] + "dump" + color['default'])
|
print(" " + color['green'] + "dump" + color['default']);
|
||||||
print(" Dump all the module dependency and properties")
|
print(" Dump all the module dependency and properties");
|
||||||
print(" " + color['green'] + "dependency" + color['default'])
|
print(" " + color['green'] + "dependency" + color['default']);
|
||||||
print(" generate a file dependency.dot that represent all the dependency link")
|
print(" generate a file dependency.dot that represent all the dependency link");
|
||||||
print(" Select what in included: 'dependency:LPBDK'")
|
print(" Select what in included: 'dependency:LPBDK'");
|
||||||
print(" L: Library")
|
print(" L: Library");
|
||||||
print(" P: Pre-build")
|
print(" P: Pre-build");
|
||||||
print(" D: Data")
|
print(" D: Data");
|
||||||
print(" B: Binary")
|
print(" B: Binary");
|
||||||
print(" K: Package")
|
print(" K: Package");
|
||||||
print(" eg: lutin dependency:LD ; dot -Tsvg dependency.dot -o dependency.svg ; firefox dependency.svg")
|
print(" eg: lutin dependency:LD ; dot -Tsvg dependency.dot -o dependency.svg ; firefox dependency.svg");
|
||||||
print(" " + color['green'] + "gcov" + color['default'])
|
print(" " + color['green'] + "gcov" + color['default']);
|
||||||
print(" Parse all the code of the library with the gcov resolution")
|
print(" Parse all the code of the library with the gcov resolution");
|
||||||
|
print(" " + color['green'] + "run" + color['default']);
|
||||||
|
print(" Execute the application in the module. add ':' to add parameter to set in the program parameters");
|
||||||
listOfAllModule = module.list_all_module_with_desc()
|
listOfAllModule = module.list_all_module_with_desc()
|
||||||
for mod in listOfAllModule:
|
for mod in listOfAllModule:
|
||||||
data_print = " "
|
data_print = " "
|
||||||
@ -172,6 +175,7 @@ def usage(full=False):
|
|||||||
print(" ex complex arguments : " + sys.argv[0] + " -cclang -mdebug zeus-package-base?build?run%zeus-launcher:--srv=user:--elog-level=5")
|
print(" ex complex arguments : " + sys.argv[0] + " -cclang -mdebug zeus-package-base?build?run%zeus-launcher:--srv=user:--elog-level=5")
|
||||||
print(" ex gcov: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov")
|
print(" ex gcov: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov")
|
||||||
print(" ex gcov with output: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov:output")
|
print(" ex gcov with output: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov:output")
|
||||||
|
print(" ex multiple test execution with end resume: " + sys.argv[0] + " --async-fail -cgcc -mdebug *-test?build?run")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|
||||||
@ -224,22 +228,29 @@ def parseGenericArg(argument, active):
|
|||||||
return True
|
return True
|
||||||
if argument.get_option_name() == "list-target":
|
if argument.get_option_name() == "list-target":
|
||||||
if active == False:
|
if active == False:
|
||||||
list_of_target = target.list_all_target()
|
list_of_target = target.list_all_target();
|
||||||
retValue = ""
|
retValue = "";
|
||||||
for targetName in list_of_target:
|
for targetName in list_of_target:
|
||||||
if retValue != "":
|
if retValue != "":
|
||||||
retValue += " "
|
retValue += " ";
|
||||||
retValue += targetName
|
retValue += targetName;
|
||||||
print(retValue)
|
print(retValue);
|
||||||
exit(0)
|
exit(0);
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name()=="jobs":
|
elif argument.get_option_name()=="jobs":
|
||||||
if active == True:
|
if active == True:
|
||||||
multiprocess.set_core_number(int(argument.get_arg()))
|
multiprocess.set_core_number(int(argument.get_arg()));
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name()=="depth":
|
elif argument.get_option_name()=="depth":
|
||||||
if active == True:
|
if active == True:
|
||||||
env.set_parse_depth(int(argument.get_arg()))
|
env.set_parse_depth(int(argument.get_arg()));
|
||||||
|
return True
|
||||||
|
elif argument.get_option_name()=="async-fail":
|
||||||
|
if active == True:
|
||||||
|
if check_boolean(argument.get_arg()) == True:
|
||||||
|
env.set_async_fail(True);
|
||||||
|
else:
|
||||||
|
env.set_async_fail(False);
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name()=="ccache":
|
elif argument.get_option_name()=="ccache":
|
||||||
if active == True:
|
if active == True:
|
||||||
@ -379,36 +390,37 @@ config = {
|
|||||||
"gcov":False,
|
"gcov":False,
|
||||||
"compilator-version":""
|
"compilator-version":""
|
||||||
}
|
}
|
||||||
|
elementErrors = [];
|
||||||
# load the default target :
|
# load the default target :
|
||||||
my_target = None
|
my_target = None;
|
||||||
actionDone=False
|
actionDone=False;
|
||||||
# parse all argument
|
# parse all argument
|
||||||
for argument in localArgument:
|
for argument in localArgument:
|
||||||
if parseGenericArg(argument, False) == True:
|
if parseGenericArg(argument, False) == True:
|
||||||
continue
|
continue;
|
||||||
elif argument.get_option_name() == "compilator-version":
|
elif argument.get_option_name() == "compilator-version":
|
||||||
config["compilator-version"] = argument.get_arg()
|
config["compilator-version"] = argument.get_arg();
|
||||||
elif argument.get_option_name() == "package":
|
elif argument.get_option_name() == "package":
|
||||||
config["generate-package"]=False
|
config["generate-package"]=False;
|
||||||
elif argument.get_option_name() == "simulation":
|
elif argument.get_option_name() == "simulation":
|
||||||
config["simulation"]=True
|
config["simulation"]=True;
|
||||||
elif argument.get_option_name() == "gcov":
|
elif argument.get_option_name() == "gcov":
|
||||||
config["gcov"]=True
|
config["gcov"]=True;
|
||||||
elif argument.get_option_name() == "bus":
|
elif argument.get_option_name() == "bus":
|
||||||
config["bus-size"]=argument.get_arg()
|
config["bus-size"]=argument.get_arg();
|
||||||
elif argument.get_option_name() == "arch":
|
elif argument.get_option_name() == "arch":
|
||||||
config["arch"]=argument.get_arg()
|
config["arch"]=argument.get_arg();
|
||||||
elif argument.get_option_name() == "compilator":
|
elif argument.get_option_name() == "compilator":
|
||||||
if config["compilator"] != argument.get_arg():
|
if config["compilator"] != argument.get_arg():
|
||||||
debug.debug("change compilator ==> " + argument.get_arg())
|
debug.debug("change compilator ==> " + argument.get_arg());
|
||||||
config["compilator"] = argument.get_arg()
|
config["compilator"] = argument.get_arg();
|
||||||
#remove previous target
|
#remove previous target
|
||||||
my_target = None
|
my_target = None;
|
||||||
elif argument.get_option_name() == "target":
|
elif argument.get_option_name() == "target":
|
||||||
# No check input ==> this will be verify automaticly chen the target will be loaded
|
# No check input ==> this will be verify automaticly chen the target will be loaded
|
||||||
if targetName != argument.get_arg():
|
if targetName != argument.get_arg():
|
||||||
targetName = argument.get_arg()
|
targetName = argument.get_arg();
|
||||||
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
|
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release");
|
||||||
#reset properties by defauult:
|
#reset properties by defauult:
|
||||||
config = {
|
config = {
|
||||||
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||||
@ -419,52 +431,75 @@ for argument in localArgument:
|
|||||||
"simulation":False,
|
"simulation":False,
|
||||||
"gcov":False,
|
"gcov":False,
|
||||||
"compilator-version":""
|
"compilator-version":""
|
||||||
}
|
};
|
||||||
#remove previous target
|
#remove previous target
|
||||||
my_target = None
|
my_target = None;
|
||||||
elif argument.get_option_name() == "mode":
|
elif argument.get_option_name() == "mode":
|
||||||
if config["mode"] != argument.get_arg():
|
if config["mode"] != argument.get_arg():
|
||||||
config["mode"] = argument.get_arg()
|
config["mode"] = argument.get_arg();
|
||||||
debug.debug("change mode ==> " + config["mode"])
|
debug.debug("change mode ==> " + config["mode"]);
|
||||||
#remove previous target
|
#remove previous target
|
||||||
my_target = None
|
my_target = None;
|
||||||
else:
|
else:
|
||||||
argument_value = argument.get_arg()
|
argument_value = argument.get_arg();
|
||||||
debug.debug("something request : '" + argument_value + "'")
|
debug.debug("something request : '" + argument_value + "'");
|
||||||
if argument.get_option_name() != "":
|
if argument.get_option_name() != "":
|
||||||
debug.warning("Can not understand argument : '" + argument.get_option_name() + "'")
|
debug.warning("Can not understand argument : '" + argument.get_option_name() + "'");
|
||||||
usage()
|
usage();
|
||||||
break;
|
break;
|
||||||
name2 = argument_value.replace("@", "?")
|
name2 = argument_value.replace("@", "?");
|
||||||
gettedElement = name2.split("?")
|
gettedElement = name2.split("?");
|
||||||
module_name = gettedElement[0]
|
module_name = gettedElement[0];
|
||||||
action_list = gettedElement[1:]
|
action_list = gettedElement[1:];
|
||||||
if len(action_list) == 0:
|
if len(action_list) == 0:
|
||||||
action_list = "build"
|
action_list = "build";
|
||||||
debug.debug("requested: '" + module_name + "' ? actions:'" + str(action_list) + "'")
|
debug.debug("requested: '" + module_name + "' ? actions:'" + str(action_list) + "'");
|
||||||
multiple_module_list = []
|
multiple_module_list = [];
|
||||||
if module_name[-1] == "*":
|
if module_name[-1] == "*":
|
||||||
base_name = module_name[:-1]
|
base_name = module_name[:-1];
|
||||||
for mod in module.list_all_module():
|
for mod in module.list_all_module():
|
||||||
if mod[:len(base_name)] == base_name:
|
if mod[:len(base_name)] == base_name:
|
||||||
debug.verbose("need do it for: " + mod);
|
debug.verbose("need do it for: " + mod);
|
||||||
multiple_module_list.append(mod)
|
multiple_module_list.append(mod);
|
||||||
else:
|
else:
|
||||||
multiple_module_list.append(module_name)
|
multiple_module_list.append(module_name);
|
||||||
debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'")
|
debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'");
|
||||||
for module_name in multiple_module_list:
|
for module_name in multiple_module_list:
|
||||||
#load the target if needed :
|
#load the target if needed :
|
||||||
if my_target == None:
|
if my_target == None:
|
||||||
my_target = target.load_target(targetName, copy.deepcopy(config))
|
my_target = target.load_target(targetName, copy.deepcopy(config));
|
||||||
my_target.build(module_name, actions=action_list)
|
heritage, is_build, error_nodes = my_target.build(module_name, actions=action_list);
|
||||||
actionDone=True
|
if error_nodes != None:
|
||||||
|
for err in error_nodes:
|
||||||
|
elementErrors.append(err);
|
||||||
|
actionDone=True;
|
||||||
|
|
||||||
# if no action done : we do "all" ...
|
# if no action done : we do "all" ...
|
||||||
if actionDone==False:
|
if actionDone==False:
|
||||||
#load the target if needed :
|
#load the target if needed :
|
||||||
if my_target == None:
|
if my_target == None:
|
||||||
my_target = target.load_target(targetName, config)
|
my_target = target.load_target(targetName, config);
|
||||||
my_target.build("all")
|
heritage, is_build, error_nodes = my_target.build("all");
|
||||||
|
if error_nodes != None:
|
||||||
|
for err in error_nodes:
|
||||||
|
elementErrors.append(err);
|
||||||
|
|
||||||
|
if len(elementErrors) != 0:
|
||||||
|
have_error = False;
|
||||||
|
for elret in elementErrors:
|
||||||
|
out = " '" + str(elret["module"]) + "'";
|
||||||
|
if elret["bin"] != None:
|
||||||
|
out += " ==> bin name='" + str(elret["bin"]) + "'";
|
||||||
|
if len(elret["options"]) != 0:
|
||||||
|
out += " with option: " + str(elret["options"]);
|
||||||
|
|
||||||
|
if elret["return"] != 0:
|
||||||
|
debug.warning("[ FAIL ] " + out + " RETURN value: " + str(elret["return"]));
|
||||||
|
have_error = True;
|
||||||
|
else:
|
||||||
|
debug.info("[ OK ] " + out);
|
||||||
|
if have_error:
|
||||||
|
debug.error("Execution fail...");
|
||||||
|
|
||||||
# stop all started threads;
|
# stop all started threads;
|
||||||
multiprocess.un_init()
|
multiprocess.un_init()
|
||||||
|
24
lutin/env.py
24
lutin/env.py
@ -118,17 +118,29 @@ def get_warning_mode():
|
|||||||
global store_warning
|
global store_warning
|
||||||
return store_warning
|
return store_warning
|
||||||
|
|
||||||
ccache=False
|
ccache=False;
|
||||||
def set_ccache(val):
|
def set_ccache(val):
|
||||||
global ccache
|
global ccache;
|
||||||
if val == True:
|
if val == True:
|
||||||
ccache = True
|
ccache = True;
|
||||||
else:
|
else:
|
||||||
ccache = False
|
ccache = False;
|
||||||
|
|
||||||
def get_ccache():
|
def get_ccache():
|
||||||
global ccache
|
global ccache;
|
||||||
return ccache
|
return ccache;
|
||||||
|
|
||||||
|
async_fail=False
|
||||||
|
def set_async_fail(val):
|
||||||
|
global async_fail;
|
||||||
|
if val == True:
|
||||||
|
async_fail = True;
|
||||||
|
else:
|
||||||
|
async_fail = False;
|
||||||
|
|
||||||
|
def get_async_fail():
|
||||||
|
global async_fail;
|
||||||
|
return async_fail;
|
||||||
|
|
||||||
def end_with(name, list):
|
def end_with(name, list):
|
||||||
for appl in list:
|
for appl in list:
|
||||||
|
@ -607,7 +607,7 @@ class Module:
|
|||||||
# optionnal dependency :
|
# optionnal dependency :
|
||||||
for dep, option, export, src_file, header_file, option_not_found in self._depends_optionnal:
|
for dep, option, export, src_file, header_file, option_not_found in self._depends_optionnal:
|
||||||
debug.verbose("try find optionnal dependency: '" + str(dep) + "'")
|
debug.verbose("try find optionnal dependency: '" + str(dep) + "'")
|
||||||
inherit_list, isBuilt = target.build(dep, True, package_name=package_name)
|
inherit_list, isBuilt, build_errors = target.build(dep, True, package_name=package_name)
|
||||||
if isBuilt == True:
|
if isBuilt == True:
|
||||||
self._local_heritage.add_depends(dep);
|
self._local_heritage.add_depends(dep);
|
||||||
self.add_flag(option[0], option[1], export=export);
|
self.add_flag(option[0], option[1], export=export);
|
||||||
@ -619,7 +619,7 @@ class Module:
|
|||||||
self._sub_heritage_list.add_heritage_list(inherit_list)
|
self._sub_heritage_list.add_heritage_list(inherit_list)
|
||||||
for dep in self._depends:
|
for dep in self._depends:
|
||||||
debug.debug("module: '" + str(self._name) + "' request: '" + dep + "'")
|
debug.debug("module: '" + str(self._name) + "' request: '" + dep + "'")
|
||||||
inherit_list = target.build(dep, False, package_name=package_name)
|
inherit_list, isBuilt, build_errors = target.build(dep, False, package_name=package_name)
|
||||||
# add at the heritage list :
|
# add at the heritage list :
|
||||||
self._sub_heritage_list.add_heritage_list(inherit_list)
|
self._sub_heritage_list.add_heritage_list(inherit_list)
|
||||||
# do sub library action for automatic generating ...
|
# do sub library action for automatic generating ...
|
||||||
|
@ -156,7 +156,7 @@ list_of_element_availlable=[
|
|||||||
"."
|
"."
|
||||||
],
|
],
|
||||||
"compilation-version": {
|
"compilation-version": {
|
||||||
"c++": 2017,
|
"c++": 2017, # -2017 for gnu17
|
||||||
"java": 16
|
"java": 16
|
||||||
},
|
},
|
||||||
"dependency": [
|
"dependency": [
|
||||||
@ -660,6 +660,9 @@ def GLD_add_depend(my_module, data):
|
|||||||
|
|
||||||
def GLD_compile_version(my_module, data):
|
def GLD_compile_version(my_module, data):
|
||||||
for elem in data.keys():
|
for elem in data.keys():
|
||||||
|
if data[elem] < 0:
|
||||||
|
my_module.compile_version(elem, -data[elem], gnu=True)
|
||||||
|
else:
|
||||||
my_module.compile_version(elem, data[elem])
|
my_module.compile_version(elem, data[elem])
|
||||||
|
|
||||||
def GLD_copy(my_module, data):
|
def GLD_copy(my_module, data):
|
||||||
|
@ -657,6 +657,7 @@ class Target:
|
|||||||
## @return (None|Module handle| ...) complicated return ...
|
## @return (None|Module handle| ...) complicated return ...
|
||||||
##
|
##
|
||||||
def build(self, name, optionnal=False, actions=[], package_name=None):
|
def build(self, name, optionnal=False, actions=[], package_name=None):
|
||||||
|
debug.extreme_verbose("call build ... " + str(name));
|
||||||
if len(name.split("?")) != 1\
|
if len(name.split("?")) != 1\
|
||||||
or len(name.split("@")) != 1:
|
or len(name.split("@")) != 1:
|
||||||
debug.error("need update")
|
debug.error("need update")
|
||||||
@ -727,6 +728,7 @@ class Target:
|
|||||||
list_of_all_element = module.list_filtered_module(name);
|
list_of_all_element = module.list_filtered_module(name);
|
||||||
else:
|
else:
|
||||||
list_of_all_element = [name]
|
list_of_all_element = [name]
|
||||||
|
global_run_error = [];
|
||||||
for module_name in list_of_all_element:
|
for module_name in list_of_all_element:
|
||||||
action_list = actions
|
action_list = actions
|
||||||
for action_name in action_list:
|
for action_name in action_list:
|
||||||
@ -743,16 +745,17 @@ class Target:
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
debug.error("target have no 'un_install_package' instruction")
|
debug.error("target have no 'un_install_package' instruction")
|
||||||
elif action_name[:3] == "run":
|
elif action_name[:3] == "run":
|
||||||
|
sub_action_name = action_name[3:];
|
||||||
"""
|
"""
|
||||||
if mod.get_type() != "BINARY" \
|
if mod.get_type() != "BINARY" \
|
||||||
and mod.get_type() != "PACKAGE":
|
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' ... pakage='" + mod.get_type() + "' for module='" + module_name + "'")
|
||||||
"""
|
"""
|
||||||
bin_name = None
|
bin_name = None
|
||||||
if len(action_name) > 3:
|
if len(sub_action_name) > 0:
|
||||||
if action_name[3] == '%':
|
if sub_action_name[0] == '%':
|
||||||
bin_name = ""
|
bin_name = ""
|
||||||
for elem in action_name[4:]:
|
for elem in sub_action_name[1:]:
|
||||||
if elem == ":":
|
if elem == ":":
|
||||||
break;
|
break;
|
||||||
bin_name += elem
|
bin_name += elem
|
||||||
@ -765,19 +768,25 @@ class Target:
|
|||||||
option_list = []
|
option_list = []
|
||||||
else:
|
else:
|
||||||
option_list = []
|
option_list = []
|
||||||
#try:
|
|
||||||
self.run(module_name, option_list, bin_name)
|
ret = self.run(module_name, option_list, bin_name);
|
||||||
#except AttributeError:
|
|
||||||
# debug.error("target have no 'run' instruction")
|
|
||||||
elif action_name == "log":
|
|
||||||
try:
|
|
||||||
self.show_log(module_name)
|
|
||||||
except AttributeError:
|
|
||||||
debug.error("target have no 'show_log' instruction")
|
|
||||||
else:
|
else:
|
||||||
option_list = []
|
option_list = []
|
||||||
#try:
|
#try:
|
||||||
self.run(module_name, option_list, bin_name)
|
ret = self.run(module_name, option_list, bin_name)
|
||||||
|
if env.get_async_fail():
|
||||||
|
if ret != 0:
|
||||||
|
debug.error("FAIL in execute process : '" + str(module_name) + "' ==> bin name='" + str(bin_name) + "' with option: " + str(option_list) + " RETURN value: " + str(ret));
|
||||||
|
else:
|
||||||
|
debug.warning("FAIL in execute process : '" + str(module_name) + "' ==> bin name='" + str(bin_name) + "' with option: " + str(option_list) + " RETURN value: " + str(ret));
|
||||||
|
else:
|
||||||
|
global_run_error.append({
|
||||||
|
"module": module_name,
|
||||||
|
"bin": bin_name,
|
||||||
|
"options": option_list,
|
||||||
|
"return": ret,
|
||||||
|
"type": "Execution Fail ..."
|
||||||
|
})
|
||||||
#except AttributeError:
|
#except AttributeError:
|
||||||
# debug.error("target have no 'run' instruction")
|
# debug.error("target have no 'run' instruction")
|
||||||
elif action_name == "log":
|
elif action_name == "log":
|
||||||
@ -789,7 +798,7 @@ class Target:
|
|||||||
present = self.load_if_needed(module_name, optionnal=optionnal)
|
present = self.load_if_needed(module_name, optionnal=optionnal)
|
||||||
if present == False \
|
if present == False \
|
||||||
and optionnal == True:
|
and optionnal == True:
|
||||||
ret = [heritage.HeritageList(), False]
|
ret = [heritage.HeritageList(), False, None]
|
||||||
else:
|
else:
|
||||||
for mod in self.module_list:
|
for mod in self.module_list:
|
||||||
debug.verbose("compare " + mod.get_name() + " == " + module_name)
|
debug.verbose("compare " + mod.get_name() + " == " + module_name)
|
||||||
@ -823,23 +832,25 @@ class Target:
|
|||||||
if len(action_name) > 5:
|
if len(action_name) > 5:
|
||||||
debug.warning("action 'build' does not support options ... : '" + action_name + "'")
|
debug.warning("action 'build' does not support options ... : '" + action_name + "'")
|
||||||
debug.debug("build module '" + module_name + "'")
|
debug.debug("build module '" + module_name + "'")
|
||||||
if optionnal == True:
|
ret = [mod.build(self, package_name), True, None]
|
||||||
ret = [mod.build(self, package_name), True]
|
|
||||||
else:
|
|
||||||
ret = mod.build(self, package_name)
|
|
||||||
break
|
break
|
||||||
# at the end of the build selected...
|
# at the end of the build selected...
|
||||||
if optionnal == True \
|
if optionnal == True \
|
||||||
and ret == None:
|
and ret == None:
|
||||||
ret = [heritage.HeritageList(), False]
|
ret = [heritage.HeritageList(), False, None]
|
||||||
break
|
break
|
||||||
if ret == None:
|
if ret == None:
|
||||||
debug.error("not know module name : '" + module_name + "' to '" + action_name + "' it")
|
debug.error("not know module name : '" + module_name + "' to '" + action_name + "' it")
|
||||||
debug.verbose("requested : " + module_name + "?" + action_name + " [STOP]")
|
debug.verbose("requested : " + module_name + "?" + action_name + " [STOP]")
|
||||||
|
#display errors
|
||||||
|
if len(global_run_error) != 0:
|
||||||
|
pass;
|
||||||
|
else:
|
||||||
if len(action_list) == 1 and len(list_of_all_element) == 1:
|
if len(action_list) == 1 and len(list_of_all_element) == 1:
|
||||||
return ret
|
return ret
|
||||||
# end of all element processing...
|
# end of all element processing...
|
||||||
|
if len(global_run_error) != 0:
|
||||||
|
return [None, False, global_run_error];
|
||||||
##
|
##
|
||||||
## @brief Add action to do for package specific part when build upper element
|
## @brief Add action to do for package specific part when build upper element
|
||||||
## @param[in] name_of_state (string) a state to call action
|
## @param[in] name_of_state (string) a state to call action
|
||||||
@ -1152,28 +1163,29 @@ class Target:
|
|||||||
or ret_changelog
|
or ret_changelog
|
||||||
|
|
||||||
def install_package(self, pkg_name):
|
def install_package(self, pkg_name):
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.info("-- Install package '" + pkg_name + "'")
|
debug.info("-- Install package '" + pkg_name + "'");
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.error("action not implemented ...")
|
debug.error("action not implemented ...");
|
||||||
|
|
||||||
def un_install_package(self, pkg_name):
|
def un_install_package(self, pkg_name):
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.info("-- Un-Install package '" + pkg_name + "'")
|
debug.info("-- Un-Install package '" + pkg_name + "'");
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.error("action not implemented ...")
|
debug.error("action not implemented ...");
|
||||||
|
|
||||||
def run(self, pkg_name, option_list, binary_name = None):
|
def run(self, pkg_name, option_list, binary_name = None):
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
|
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list));
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.error("action not implemented ...")
|
debug.warning("action not implemented ...");
|
||||||
|
return -1;
|
||||||
|
|
||||||
def show_log(self, pkg_name):
|
def show_log(self, pkg_name):
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.info("-- Show log logcat '" + pkg_name + "'")
|
debug.info("-- Show log logcat '" + pkg_name + "'");
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------");
|
||||||
debug.error("action not implemented ...")
|
debug.error("action not implemented ...");
|
||||||
|
|
||||||
##
|
##
|
||||||
## @brief convert a s list of string in a string separated by a ","
|
## @brief convert a s list of string in a string separated by a ","
|
||||||
|
40
lutin/z_system/lutinSystem_Linux_bsd.py
Normal file
40
lutin/z_system/lutinSystem_Linux_bsd.py
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license MPL v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from realog import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
from lutin import env
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.set_help("bz2 : ???")
|
||||||
|
# No check ==> on the basic std libs:
|
||||||
|
self.set_valid(True)
|
||||||
|
# todo : create a searcher of the presence of the library:
|
||||||
|
self.add_flag("link-lib", "bsd")
|
||||||
|
self.add_depend([
|
||||||
|
'c'
|
||||||
|
])
|
||||||
|
"""
|
||||||
|
if env.get_isolate_system() == True:
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/sys/mman.h",
|
||||||
|
"/usr/include/sys/stat.h"
|
||||||
|
],
|
||||||
|
clip_path="/usr/include",
|
||||||
|
recursive=False)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
40
lutin/z_system/lutinSystem_Linux_gnutls.py
Normal file
40
lutin/z_system/lutinSystem_Linux_gnutls.py
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license MPL v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from realog import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
from lutin import env
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.set_help("bz2 : ???")
|
||||||
|
# No check ==> on the basic std libs:
|
||||||
|
self.set_valid(True)
|
||||||
|
# todo : create a searcher of the presence of the library:
|
||||||
|
self.add_flag("link-lib", "gnutls")
|
||||||
|
self.add_depend([
|
||||||
|
'c'
|
||||||
|
])
|
||||||
|
"""
|
||||||
|
if env.get_isolate_system() == True:
|
||||||
|
self.add_header_file([
|
||||||
|
"/usr/include/sys/mman.h",
|
||||||
|
"/usr/include/sys/stat.h"
|
||||||
|
],
|
||||||
|
clip_path="/usr/include",
|
||||||
|
recursive=False)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
31
lutin/z_system/lutinSystem_Linux_sodium.py
Normal file
31
lutin/z_system/lutinSystem_Linux_sodium.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license MPL v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from realog import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
from lutin import env
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.set_help("sodium : ???")
|
||||||
|
# No check ==> on the basic std libs:
|
||||||
|
self.set_valid(True)
|
||||||
|
# todo : create a searcher of the presence of the library:
|
||||||
|
self.add_flag("link-lib", "sodium")
|
||||||
|
self.add_depend([
|
||||||
|
'c'
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -174,10 +174,9 @@ class Target(target.Target):
|
|||||||
for elem in option_list:
|
for elem in option_list:
|
||||||
cmd += elem + " ";
|
cmd += elem + " ";
|
||||||
ret = multiprocess.run_command_pwd(cmd, appl_path);
|
ret = multiprocess.run_command_pwd(cmd, appl_path);
|
||||||
if ret != 0:
|
|
||||||
debug.error("application exit with error: " + str(ret));
|
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.info("-- Run package '" + pkg_name + "' Finished")
|
debug.info("-- Run package '" + pkg_name + "' Finished ret=" + str(ret))
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user