]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
ajout d'un répertoire local ARCHIVES pour le stockage des archives - modification... dev_archive
authorcrouzet <nicolas.crouzet@cea.fr>
Wed, 25 Oct 2017 14:18:36 +0000 (16:18 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Wed, 25 Oct 2017 14:18:36 +0000 (16:18 +0200)
commands/config.py
commands/init.py
commands/jobs.py
commands/package.py
data/local.pyconf

index 084df54a450abc29a9b71e0450c827384bc90dc4..5d48be5da9ecd2d6ca95eac7303bdefc6583048e 100644 (file)
@@ -263,22 +263,28 @@ class ConfigManager:
             raise src.SatException( e );
         merger.merge(cfg, local_cfg)
 
-        # When the key is "unknown", put the default value
-        if cfg.LOCAL.base == "unknown":
+        # When the key is "default", put the default value
+        if cfg.LOCAL.base == "default":
             cfg.LOCAL.base = os.path.abspath(
                                         os.path.join(cfg.VARS.salometoolsway,
                                                      "..",
                                                      "BASE"))
-        if cfg.LOCAL.workdir == "unknown":
+        if cfg.LOCAL.workdir == "default":
             cfg.LOCAL.workdir = os.path.abspath(
                                         os.path.join(cfg.VARS.salometoolsway,
                                                      ".."))
-        if cfg.LOCAL.log_dir == "unknown":
+        if cfg.LOCAL.log_dir == "default":
             cfg.LOCAL.log_dir = os.path.abspath(
                                         os.path.join(cfg.VARS.salometoolsway,
                                                      "..",
                                                      "LOGS"))
 
+        if cfg.LOCAL.archive_dir == "default":
+            cfg.LOCAL.archive_dir = os.path.abspath(
+                                        os.path.join(cfg.VARS.salometoolsway,
+                                                     "..",
+                                                     "ARCHIVES"))
+
         # apply overwrite from command line if needed
         for rule in self.get_command_line_overrides(options, ["LOCAL"]):
             exec('cfg.' + rule) # this cannot be factorized because of the exec
@@ -340,6 +346,10 @@ class ConfigManager:
         cfg.PATHS.JOBPATH.append(cfg.VARS.personal_jobs_dir, "")
         cfg.PATHS["MACHINEPATH"] = src.pyconf.Sequence(cfg.PATHS)
         cfg.PATHS.MACHINEPATH.append(cfg.VARS.personal_machines_dir, "")
+
+        # initialise the path with local directory
+        cfg.PATHS["ARCHIVEPATH"].append(cfg.LOCAL.archive_dir, "")
+
         # Loop over the projects in order to complete the PATHS variables
         for project in cfg.PROJECTS.projects:
             for PATH in ["APPLICATIONPATH",
@@ -516,14 +526,15 @@ class ConfigManager:
                                  'evince', 
                                  "This is the pdf_viewer used "
                                  "to read pdf documentation\n")
-        user_cfg.USER.addMapping("base",
-                                 src.pyconf.Reference(
-                                            user_cfg,
-                                            src.pyconf.DOLLAR,
-                                            'workdir  + $VARS.sep + "BASE"'),
-                                 "The products installation base (could be "
-                                 "ignored if this key exists in the local.pyconf"
-                                 " file of salomTools).\n")
+# CNC 25/10/17 : plus nécessaire a priori
+#        user_cfg.USER.addMapping("base",
+#                                 src.pyconf.Reference(
+#                                            user_cfg,
+#                                            src.pyconf.DOLLAR,
+#                                            'workdir  + $VARS.sep + "BASE"'),
+#                                 "The products installation base (could be "
+#                                 "ignored if this key exists in the local.pyconf"
+#                                 " file of salomTools).\n")
                
         # 
         src.ensure_path_exists(config.VARS.personalDir)
index 0a0103a0266508205f32cd60d96c1015568d4f16..03325576c40fea486332e4d7390a8e10ec140f5e 100644 (file)
@@ -27,6 +27,9 @@ parser.add_option('b', 'base', 'string', 'base',
 parser.add_option('w', 'workdir', 'string', 'workdir', 
                   _('Optional: The path to the working directory '
                     '(where to install the applications'))
+parser.add_option('a', 'archive_dir', 'string', 'archive_dir', 
+                  _('Optional: The path to the local archive directory '
+                    '(where to install local source archives'))
 parser.add_option('v', 'VCS', 'string', 'VCS', 
                   _('Optional: The address of the repository of SAT '
                     '(only informative)'))
@@ -73,6 +76,7 @@ def display_local_values(config, logger):
     info = [("base", config.LOCAL.base),
             ("workdir", config.LOCAL.workdir),
             ("log_dir", config.LOCAL.log_dir),
+            ("archive_dir", config.LOCAL.archive_dir),
             ("VCS", config.LOCAL.VCS),
             ("tag", config.LOCAL.tag)]
     src.print_info(logger, info)
@@ -85,7 +89,7 @@ def check_path(path_to_check, logger):
     :param path_to_check Str: The path to check.
     :param logger Logger: The logger instance.
     """
-    if path_to_check == "unknown":
+    if path_to_check == "default":
         return 0
     
     # Get the path
@@ -134,7 +138,8 @@ def run(args, runner, logger):
     # Set the options corresponding to a directory
     for opt in [("base" , options.base),
                 ("workdir", options.workdir),
-                ("log_dir", options.log_dir)]:
+                ("log_dir", options.log_dir),
+                ("archive_dir", options.archive_dir)]:
         key, value = opt
         if value:
             res_check = check_path(value, logger)
@@ -151,4 +156,4 @@ def run(args, runner, logger):
     
     display_local_values(runner.cfg, logger)
     
-    return res
\ No newline at end of file
+    return res
index 42b5c1a7a43bbbe2c40efe2025b5c9e00a88843d..15d33f85a90a6b633df69e15ab3c5257b7a9ffce 100644 (file)
@@ -825,8 +825,8 @@ class Jobs(object):
                 # the init command
                 (__, out_dist, __) = machine.exec_command(
                                 os.path.join(machine.sat_path,
-                                    "sat init --base unknown --workdir"
-                                    " unknown --log_dir unknown"),
+                                    "sat init --base default --workdir"
+                                    " default --log_dir default"),
                                 self.logger)
                 out_dist.read()    
                 
index 5c2da38c8c86430ac9f9a2b51b02c1a437cb7aea..0d8946b9e90ae37490a12c8abda6bcaed2d79119 100644 (file)
@@ -64,9 +64,10 @@ LOCAL_TEMPLATE = ("""#!/usr/bin/env python
 
   LOCAL :
   {
-    base : 'unknown'
-    workdir : 'unknown'
-    log_dir : 'unknown'
+    base : 'default'
+    workdir : 'default'
+    log_dir : 'default'
+    archive_dir : 'default'
     VCS : None
     tag : None
   }
index baf2b8c36e6db2eeb13261d8fed943a7309fb5da..3646f263431387914c3ac044e147b012448f36a2 100644 (file)
@@ -1,10 +1,11 @@
-#!/usr/bin/env python
+  #!/usr/bin/env python
 #-*- coding:utf-8 -*-
   LOCAL :
   {
-    base : 'unknown'
-    workdir : 'unknown'
-    log_dir : 'unknown'
+    base : 'default'
+    workdir : 'default'
+    log_dir : 'default'
+    archive_dir : 'default'
     VCS : None
     tag : None
   }