From: Christian Van Wambeke Date: Mon, 17 Dec 2018 13:55:43 +0000 (+0100) Subject: fix sat compile from detar problem file sat-product.pyconf evaluation X-Git-Tag: 5.3.0~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cc61417c83233ac0f3197c7b74886c30642c5cd9;p=tools%2Fsat.git fix sat compile from detar problem file sat-product.pyconf evaluation --- diff --git a/src/product.py b/src/product.py index f1fa34b..9bb1116 100644 --- a/src/product.py +++ b/src/product.py @@ -480,12 +480,25 @@ 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 - p_info.__save__(f, evaluated=True) # evaluated expressions mode - + 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): """\