Salome HOME
merge with master
[tools/sat.git] / src / product.py
index 04ade2e8a6ad1e021eaa6fc2537cdc0c4019e44c..627e82a1cfa468b2d9018a7c62e103b6f8cf6c7a 100644 (file)
@@ -470,19 +470,23 @@ def add_compile_config_file(p_info, config):
     with open(aFile, 'w') as f:
       res.__save__(f)
 
-    # this file is for human eye reading
+    # this file is not mandatory, is for human eye reading
     aFile = os.path.join(p_info.install_dir, PRODUCT_FILENAME)
-    with open(aFile, 'w') as f:
-      # f.write(DBG.getStrConfigDbg(p_info)) # debug mode
-      try:
-          p_info.__save__(f, evaluated=True) # evaluated expressions mode
-      except:
-          # the second file is not mandatory. In the context of non VCS archives, p_info cannot be evaluated
-          # because information on git server is not available.  In this case, we skip the writing without raising an error.
-          #DBG.write("cannot evaluate product info - do not write ", PRODUCT_FILENAME, True)
-          pass
-          
-
+    try:
+      with open(aFile, 'w') as f:
+        p_info.__save__(f, evaluated=True) # evaluated expressions mode
+    except:
+      DBG.write("cannot evaluate product info - problem in file %s" % aFile, p_info, True)
+      # write DBG mode, as no problem if evaluation not possible
+      msg = """\
+# Some informations cannot be evaluated.
+# for example:
+# In the context of non VCS archives, information on git server is not available.
+  
+"""
+      with open(aFile, 'w') as f:
+        f.write(msg)
+        f.write(DBG.getStrConfigDbg(p_info))
 
 def check_config_exists(config, prod_dir, prod_info, verbose=False):
     """\