'''
# read the pyconf of the product
- product_pyconf_path = src.find_file_in_lpath(p_name + ".pyconf",
- config.PATHS.PRODUCTPATH)
- product_pyconf_cfg = src.pyconf.Config(product_pyconf_path)
+ product_pyconf_cfg = src.pyconf.Config(p_info.from_file)
# find the compilation script if any
if src.product.product_has_script(p_info):
compil_script_path = src.Path(p_info.compil_script)
compil_script_path.copy(compil_scripts_tmp_dir)
- product_pyconf_cfg[p_info.section].compil_script = os.path.basename(
- p_info.compil_script)
+
# find the environment script if any
if src.product.product_has_env_script(p_info):
env_script_path = src.Path(p_info.environ.env_script)
env_script_path.copy(env_scripts_tmp_dir)
- product_pyconf_cfg[p_info.section].environ.env_script = os.path.basename(
- p_info.environ.env_script)
+
# find the patches if any
if src.product.product_has_patches(p_info):
patches = src.pyconf.Sequence()
p_path.copy(patches_tmp_dir)
patches.append(os.path.basename(patch_path), "")
- product_pyconf_cfg[p_info.section].patches = patches
-
- if with_vcs:
- # put in the pyconf file the resolved values
- for info in ["git_info", "cvs_info", "svn_info"]:
- if info in p_info:
- for key in p_info[info]:
- product_pyconf_cfg[p_info.section][info][key] = p_info[
- info][key]
- else:
- # if the product is not archive, then make it become archive.
- if src.product.product_is_vcs(p_info):
- product_pyconf_cfg[p_info.section].get_source = "archive"
- if not "archive_info" in product_pyconf_cfg[p_info.section]:
- product_pyconf_cfg[p_info.section].addMapping("archive_info",
+ if (not with_vcs) and src.product.product_is_vcs(p_info):
+ # in non vcs mode, if the product is not archive, then make it become archive.
+
+ # depending upon the incremental mode, select impacted sections
+ if "properties" in p_info and "incremental" in p_info.properties and\
+ p_info.properties.incremental == "yes":
+ sections = ["default", "default_win", p_info.section, p_info.section+"_win"]
+ else:
+ sections = [p_info.section]
+ for section in sections:
+ if section in product_pyconf_cfg and "get_source" in product_pyconf_cfg[section]:
+ DBG.write("sat package set archive mode to archive for product %s and section %s" %\
+ (p_name,section))
+ product_pyconf_cfg[section].get_source = "archive"
+ if not "archive_info" in product_pyconf_cfg[section]:
+ product_pyconf_cfg[section].addMapping("archive_info",
src.pyconf.Mapping(product_pyconf_cfg),
"")
- product_pyconf_cfg[p_info.section
- ].archive_info.archive_name = p_info.name + ".tgz"
+ product_pyconf_cfg[section].archive_info.archive_name =\
+ p_info.name + ".tgz"
# write the pyconf file to the temporary project location
product_tmp_pyconf_path = os.path.join(products_pyconf_tmp_dir,
return prod_info
-def get_product_section(config, product_name, version, section=None, verbose=False):
+def get_product_section(config, product_name, version, section=None):
"""Build the product description from the configuration
:param config Config: The global configuration
# in this (historic) mode the definition of the product is given by a full unique section
is_incr=False
if is_incr:
- DBG.write("Incremental definition mode activated for %s" % (product_name), "", verbose)
+ DBG.write("Incremental definition mode activated for", product_name)
# decode version number
try:
except: # example setuptools raise "minor in major_minor_patch is not integer: '0_6c11'"
versionMMP = None
DBG.write("get_product_section for product %s '%s' as version '%s'" % (product_name, version, versionMMP),
- (section, aProd.keys()), verbose)
+ (section, aProd.keys()))
# if a section is explicitely specified we select it
if section:
# If it exists, get the information of the product_version
# ex: 'version_V6_6_0' as salome version classical syntax
elif "version_" + version in aProd:
- DBG.write("found section for version_" + version, "", verbose)
+ DBG.write("found section for version_" + version)
# returns specific information for the given version
pi = aProd["version_" + version]
pi.section = "version_" + version
# DBG.write("name", name,True)
aRange = VMMP.getRange_majorMinorPatch(name)
if aRange is not None:
- DBG.write("found version range for section '%s'" % name, aRange, verbose)
+ DBG.write("found version range for section '%s'" % name, aRange)
l_section_ranges.append((name, aRange))
if versionMMP is not None and len(l_section_ranges) > 0:
if len(tagged) > 1:
DBG.write("multiple version ranges tagged for '%s', fix it" % version,
- PP.pformat(tagged), True)
+ PP.pformat(tagged))
pi=None
elif len(tagged) == 1: # ok
DBG.write("one version range tagged for '%s'" % version,
- PP.pformat(tagged), verbose)
+ PP.pformat(tagged))
name, (vmin, vmax) = tagged[0]
pi = aProd[name]
pi.section = name
elif "default" in aProd:
# returns the generic information (given version not found)
pi = aProd.default
- DBG.write("default tagged for '%s'" % version, pi, verbose)
+ DBG.write("default tagged for '%s'" % version, pi)
pi.section = "default"
pi.from_file = aProd.from_file
else:
if src.architecture.is_windows() and win_section in aProd:
for key in aProd[win_section]:
prod_info[key]=aProd[win_section][key]
+ DBG.write("Incremental definition, return product info :", prod_info)
else:
prod_info=pi