# Get the hpc if any
if 'hpc' in dic_version:
- hpc = dic_version.hpc
+ hpc = dic_version['hpc']
elif 'hpc' in config.APPLICATION:
hpc = config.APPLICATION.hpc
# merge opt_depend in depend
if prod_info is not None and 'opt_depend' in prod_info:
for depend in prod_info.opt_depend:
- if depend in config.APPLICATION.products:
+ if (depend in config.APPLICATION.products) and (depend not in prod_info.depend) :
prod_info.depend.append(depend,'')
if os.path.exists(prod_info.compil_script) and not os.access(prod_info.compil_script, os.X_OK):
DBG.tofix("Compilation script file is not in 'execute mode'", prod_info.compil_script, True)
+ # If the product has a post install script, check the script existence
+ # and if it is executable
+ if product_has_post_script(prod_info):
+ # Check the compil_script key existence
+
+ # Get the path of the script file
+ # if windows supposed '.bat', if linux supposed '.sh'
+ # but user set extension script file in his pyconf as he wants, no obligation.
+ script = prod_info.post_script
+ script_name = os.path.basename(script)
+ if script == script_name:
+ # Only a name is given. Search in the default directory
+ script_path = src.find_file_in_lpath(script_name, config.PATHS.PRODUCTPATH, "post_scripts")
+ if not script_path:
+ msg = _("Post install script %s not found in") % script_name
+ DBG.tofix(msg, config.PATHS.PRODUCTPATH, True) # say where searched
+ script_path = "%s_(Not_Found_by_Sat!!)" % script_name
+ prod_info.post_script = script_path
+
+
+ # Check that the script is executable
+ if os.path.exists(prod_info.post_script) and not os.access(prod_info.post_script, os.X_OK):
+ DBG.tofix("Post install script file is not in 'execute mode'", prod_info.post_script, True)
+
# Get the full paths of all the patches
if product_has_patches(prod_info):
patches = []
ko = []
res =[]
prop, value = options.properties # for example 'is_SALOME_module', 'yes'
- for p_name, p_info in resAll:
- try:
- if p_info.properties[prop] == value:
- res.append((p_name, p_info))
- ok.append(p_name)
- else:
- ko.append(p_name)
- except:
- ko.append(p_name)
+ if value[0] == '!':
+ for p_name, p_info in resAll:
+ try:
+ if p_info.properties[prop] == value[1:]:
+ ko.append(p_name)
+ else:
+ res.append((p_name, p_info))
+ ok.append(p_name)
+ except:
+ res.append((p_name, p_info))
+ ok.append(p_name)
+ else:
+ for p_name, p_info in resAll:
+ try:
+ if p_info.properties[prop] == value:
+ res.append((p_name, p_info))
+ ok.append(p_name)
+ else:
+ ko.append(p_name)
+ except:
+ ko.append(p_name)
if len(ok) != len(resAll):
logger.trace("on properties %s\n products accepted:\n %s\n products rejected:\n %s\n" %
"is_SALOME_module" in product_info.properties and
product_info.properties.is_SALOME_module == "yes")
+def product_is_configuration(product_info):
+ """Know if a product is a configuration module
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product is a configuration module, else False
+ :rtype: boolean
+ """
+ return ("properties" in product_info and
+ "configure_dependency" in product_info.properties and
+ product_info.properties.configure_dependency == "yes")
+
def product_is_fixed(product_info):
"""Know if a product is fixed
res = ( "patches" in product_info and len(product_info.patches) > 0 )
return res
+def product_has_post_script(product_info):
+ """Know if a product has a post install script
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product has one or more patches
+ :rtype: boolean
+ """
+ res = ( "post_script" in product_info and len(product_info.post_script) > 0 and not src.architecture.is_windows())
+ return res
+
def product_has_logo(product_info):
"""Know if a product has a logo (YACSGEN generate)
"""
runtime_dep={}
build_dep={}
+
if "system_info" in product_info:
- if distrib in product_info.system_info:
- sysinfo=product_info.system_info[distrib]
- else:
- sysinfo=product_info.system_info
+
+ sysinfo=product_info.system_info
+ additional_sysinfo = None
+
+ for key in sysinfo :
+ if distrib in key :
+ additional_sysinfo = sysinfo[key]
if check_cmd[0]=="rpm":
if "rpm" in sysinfo:
if "rpm_dev" in sysinfo:
for pkg in sysinfo.rpm_dev:
build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
+ if additional_sysinfo :
+ if "rpm" in additional_sysinfo:
+ for pkg in additional_sysinfo.rpm:
+ runtime_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
+ if "rpm_dev" in additional_sysinfo:
+ for pkg in additional_sysinfo.rpm_dev:
+ build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
if check_cmd[0]=="apt":
if "apt" in sysinfo:
for pkg in sysinfo.apt:
if "apt_dev" in sysinfo:
for pkg in sysinfo.apt_dev:
build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
+ if additional_sysinfo :
+ if "apt" in additional_sysinfo:
+ for pkg in additional_sysinfo.apt:
+ runtime_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
+ if "apt_dev" in additional_sysinfo:
+ for pkg in additional_sysinfo.apt_dev:
+ build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
+
return runtime_dep,build_dep