l_product_info = src.product.get_products_infos(l_products_name,
config)
l_install_dir = []
+ l_source_dir = []
l_not_installed = []
+ l_sources_not_present = []
for prod_name, prod_info in l_product_info:
# ignore the native and fixed products
if (src.product.product_is_native(prod_info)
l_install_dir.append((name_cpp, install_dir))
else:
l_not_installed.append(name_cpp)
-
+
+ # Add the sources of the products that have the property
+ # sources_in_package : "yes"
+ if src.get_property_in_product_cfg(prod_info,
+ "sources_in_package") == "yes":
+ if os.path.exists(prod_info.source_dir):
+ l_source_dir.append((prod_name, prod_info.source_dir))
+ else:
+ l_sources_not_present.append(prod_name)
+
# Print warning or error if there are some missing products
if len(l_not_installed) > 0:
text_missing_prods = ""
logger.write("%s\n%s" % (src.printcolors.printcWarning(msg),
text_missing_prods),
1)
-
+
+ # Do the same for sources
+ if len(l_sources_not_present) > 0:
+ text_missing_prods = ""
+ for p_name in l_sources_not_present:
+ text_missing_prods += "-" + p_name + "\n"
+ if not options.force_creation:
+ msg = _("ERROR: there are missing products sources:")
+ logger.write("%s\n%s" % (src.printcolors.printcError(msg),
+ text_missing_prods),
+ 1)
+ return None
+ else:
+ msg = _("WARNING: there are missing products sources:")
+ logger.write("%s\n%s" % (src.printcolors.printcWarning(msg),
+ text_missing_prods),
+ 1)
+
# construct the name of the directory that will contain the binaries
binaries_dir_name = "BINARIES-" + config.VARS.dist
for prod_name, install_dir in l_install_dir:
path_in_archive = os.path.join(binaries_dir_name, prod_name)
d_products[prod_name] = (install_dir, path_in_archive)
+
+ for prod_name, source_dir in l_source_dir:
+ path_in_archive = os.path.join("SOURCES", prod_name)
+ d_products[prod_name] = (source_dir, path_in_archive)
# create the relative launcher and add it to the files to add
if ("profile" in config.APPLICATION and
logger.write(" " + _("No install_dir for product %s\n") %
product_info.name, 5)
- if not self.for_package:
+ source_in_package = src.get_property_in_product_cfg(product_info,
+ "sources_in_package")
+ if not self.for_package or source_in_package == "yes":
# set source dir, unless no source dir
if not src.product.product_is_fixed(product_info):
src_dir = product_info.name + "_SRC_DIR"
if not self.is_defined(src_dir):
- self.set(src_dir, product_info.source_dir)
+ if not self.for_package:
+ self.set(src_dir, product_info.source_dir)
+ else:
+ self.set(src_dir, os.path.join("out_dir_Path",
+ "SOURCES",
+ product_info.name))
def set_salome_generic_product_env(self, pi):
"""Sets the generic environment for a SALOME product.