check_cmd=src.system.get_pkg_check_cmd()
logger.write("\nCheck the system dependencies declared in the application\n",1)
pkgmgr=check_cmd[0]
+ run_dep_ko=[] # list of missing run time dependencies
+ build_dep_ko=[] # list of missing compile time dependencies
for product in sorted(config.APPLICATION.products):
try:
product_info = src.product.get_product_config(config, product)
run_pkg,build_pkg=src.product.check_system_dep(check_cmd, product_info)
#logger.write("\n*** %s ***\n" % product, 1)
for pkg in run_pkg:
- logger.write(run_pkg[pkg], 1)
+ logger.write("\n - "+pkg + " : " + run_pkg[pkg], 1)
+ if "KO" in run_pkg[pkg]:
+ run_dep_ko.append(pkg)
for pkg in build_pkg:
- logger.write(build_pkg[pkg], 1)
+ logger.write("\n - "+pkg + " : " + build_pkg[pkg], 1)
+ if "KO" in build_pkg[pkg]:
+ build_dep_ko.append(pkg)
# logger.write(src.printcolors.printcInfo(" %s\n" % i), 1)
except Exception as e:
- msg = "problem with the check of system prerequisite %s\n%s\n" % (product, str(e))
+ msg = "\nproblem with the check of system prerequisite %s\n%s\n" % (product, str(e))
logger.error(msg)
-
+ raise Exception(msg)
+
+ logger.write("\n\n",1)
+ if run_dep_ko:
+ msg="Some run time system dependencies are missing!\n"+\
+ "Please install them with %s before running salome" % pkgmgr
+ logger.warning(msg)
+ logger.write("missing run time dependencies : ",1)
+ for md in run_dep_ko:
+ logger.write(md+" ",1)
+ logger.write("\n\n")
+
+ if build_dep_ko:
+ msg="Some compile time system dependencies are missing!\n"+\
+ "Please install them with %s before compiling salome" % pkgmgr
+ logger.warning(msg)
+ logger.write("missing compile time dependencies : ",1)
+ for md in build_dep_ko:
+ logger.write(md+" ",1)
+ logger.write("\n\n")
+
def show_install_dir(config, logger):
'''Prints all the used installed directories in the application.
if "apt_dev" in product_info.system_info:
for pkg in product_info.system_info.apt_dev:
build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
- #for pkg in runtime_dep:
- # print "CNC check for ", pkg
- # runtime_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
- #for pkg in build_dep:
- # build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
- #print "CNC runtime_dep=", runtime_dep
return runtime_dep,build_dep
output, err = p.communicate()
rc = p.returncode
if rc==0:
- check_res=src.printcolors.printcSuccess("OK")
+ msg_status=src.printcolors.printcSuccess("OK")
if check_cmd[0]=="rpm": # apt output is too messy for being used
- check_res+=" (" + output.replace('\n',' ') + ")\n" # remove output trailing \n
+ msg_status+=" (" + output.replace('\n',' ') + ")\n" # remove output trailing \n
else:
- check_res=src.printcolors.printcError("KO")
- check_res+=" (package is not installed!)\n"
+ msg_status=src.printcolors.printcError("KO")
+ msg_status+=" (package is not installed!)\n"
- msg_status="\n - "+pkg + " : " + check_res
return msg_status