]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
fix bug in package: sometimes, os.getcwd can fail
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Mon, 7 Nov 2016 08:36:25 +0000 (09:36 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Mon, 7 Nov 2016 08:36:25 +0000 (09:36 +0100)
commands/package.py

index d37280758ec45b44bba74779efa14c9f323c4e18..4e5400b1a6995b6dc5faaaa05f81a4df7a4c0cb7 100644 (file)
@@ -363,16 +363,21 @@ def source_package(sat, config, logger, options, tmp_working_dir):
     tmp_sat = add_salomeTools(config, tmp_working_dir)
     d_sat = {"salomeTools" : (tmp_sat, "salomeTools")}
     
-    # Add a sat symbolic link
-    tmp_satlink_path = os.path.join(tmp_working_dir, 'sat')
-    t = os.getcwd()
-    os.chdir(tmp_working_dir)
-    if os.path.lexists(tmp_satlink_path):
-        os.remove(tmp_satlink_path)
-    os.symlink(os.path.join('salomeTools', 'sat'), 'sat')
-    os.chdir(t)
-    
-    d_sat["sat link"] = (tmp_satlink_path, "sat")
+    # Add a sat symbolic link if not win
+    if not src.architecture.is_windows():
+        tmp_satlink_path = os.path.join(tmp_working_dir, 'sat')
+        try:
+            t = os.getcwd()
+        except:
+            # In the jobs, os.getcwd() can fail
+            t = config.USER.workdir
+        os.chdir(tmp_working_dir)
+        if os.path.lexists(tmp_satlink_path):
+            os.remove(tmp_satlink_path)
+        os.symlink(os.path.join('salomeTools', 'sat'), 'sat')
+        os.chdir(t)
+        
+        d_sat["sat link"] = (tmp_satlink_path, "sat")
     
     return src.merge_dicts(d_archives, d_archives_vcs, d_project, d_sat)