From 763395f8dfee0cdc0684dc3a3e81bd097e728e69 Mon Sep 17 00:00:00 2001 From: crouzet Date: Tue, 19 Nov 2019 15:34:42 +0100 Subject: [PATCH] =?utf8?q?ajout=20d'un=20r=C3=A9pertoire=20TMP=20pour=20sa?= =?utf8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- commands/config.py | 3 ++- commands/init.py | 4 ++++ commands/package.py | 2 ++ complete_sat.sh | 2 +- data/local.pyconf | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/commands/config.py b/commands/config.py index c089074..3d314e3 100644 --- a/commands/config.py +++ b/commands/config.py @@ -302,7 +302,8 @@ class ConfigManager: cfg.LOCAL.workdir = os.path.abspath(osJoin(cfg.VARS.salometoolsway, "..")) if cfg.LOCAL.log_dir == "default": cfg.LOCAL.log_dir = os.path.abspath(osJoin(cfg.VARS.salometoolsway, "..", "LOGS")) - + if cfg.LOCAL.tmp_dir == "default": + cfg.LOCAL.tmp_dir = os.path.abspath(osJoin(cfg.VARS.salometoolsway, "..", "TMP")) if cfg.LOCAL.archive_dir == "default": cfg.LOCAL.archive_dir = os.path.abspath( osJoin(cfg.VARS.salometoolsway, "..", "ARCHIVES")) diff --git a/commands/init.py b/commands/init.py index 592843a..7ef409c 100644 --- a/commands/init.py +++ b/commands/init.py @@ -41,6 +41,8 @@ parser.add_option('t', 'tag', 'string', 'tag', _('Optional: The tag of SAT (only informative)')) parser.add_option('l', 'log_dir', 'string', 'log_dir', _('Optional: The directory where to put all the logs of SAT')) +parser.add_option('', 'tmp_dir', 'string', 'tmp_dir', + _('Optional: The temporary directory used by SAT')) def set_local_value(config, key, value, logger): """ Edit the site.pyconf file and change a value. @@ -143,6 +145,7 @@ def display_local_values(config, logger): ("workdir", config.LOCAL.workdir), ("log_dir", config.LOCAL.log_dir), ("archive_dir", config.LOCAL.archive_dir), + ("tmp_dir", config.LOCAL.tmp_dir), ("VCS", config.LOCAL.VCS), ("tag", config.LOCAL.tag), ("projects", config.PROJECTS.project_file_paths)] @@ -207,6 +210,7 @@ def run(args, runner, logger): for opt in [("base" , options.base), ("workdir", options.workdir), ("log_dir", options.log_dir), + ("tmp_dir", options.tmp_dir), ("archive_dir", options.archive_dir)]: key, value = opt if value: diff --git a/commands/package.py b/commands/package.py index f4b226d..9ed100a 100644 --- a/commands/package.py +++ b/commands/package.py @@ -73,6 +73,7 @@ LOCAL_TEMPLATE = ("""#!/usr/bin/env python workdir : 'default' log_dir : 'default' archive_dir : 'default' + tmp_dir : 'default' VCS : None tag : None } @@ -1163,6 +1164,7 @@ def sat_package(config, tmp_working_dir, options, logger): local_cfg.LOCAL["workdir"] = "default" local_cfg.LOCAL["log_dir"] = "default" local_cfg.LOCAL["archive_dir"] = "default" + local_cfg.LOCAL["tmp_dir"] = "default" local_cfg.LOCAL["VCS"] = "None" local_cfg.LOCAL["tag"] = src.get_salometool_version(config) diff --git a/complete_sat.sh b/complete_sat.sh index 5e68e42..7ce15a1 100755 --- a/complete_sat.sh +++ b/complete_sat.sh @@ -59,7 +59,7 @@ _show_applications() opts2=$(echo --set $opts2) ;; init) - opts2=$(echo --base --workdir --VCS --tag --log_dir --add_project --reset_projects $opts2) + opts2=$(echo --base --workdir --VCS --tag --log_dir --tmp_dir --add_project --reset_projects $opts2) ;; esac diff --git a/data/local.pyconf b/data/local.pyconf index 7755af0..aee5fdb 100644 --- a/data/local.pyconf +++ b/data/local.pyconf @@ -5,6 +5,7 @@ workdir : 'default' log_dir : 'default' archive_dir : 'default' + tmp_dir : 'default' VCS : None tag : None } -- 2.39.2