Salome HOME
updated copyright message
[modules/kernel.git] / bin / virtual_salome.py
index 1be8dbf8e71b9338ac85049b7f3f56073390b771..7909268ed9fc1ab72cbcb7e352c0d64e40126ad2 100755 (executable)
@@ -1,5 +1,5 @@
-#  i*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+#! /usr/bin/env python3
+# Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -20,7 +20,6 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 """Create a virtual Salome installation
 
 Based on a script created by Ian Bicking.
@@ -32,7 +31,9 @@ Typical use::
 install module KERNEL in the current directory
 """
 
-import sys, os, optparse, shutil,glob,fnmatch
+import sys, os, optparse, shutil, glob, fnmatch
+
+
 py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1])
 
 verbose=0
@@ -62,7 +63,7 @@ def symlink(src, dest):
         if verbose:
             print('Creating symlink %s' % dest)
             pass
-        os.symlink(src, dest)
+        os.symlink(os.path.relpath(src,os.path.dirname(dest)), dest)
     else:
         if verbose:
             print('Symlink %s already exists' % dest)
@@ -380,7 +381,8 @@ def link_extra_test(options):
         symlink(extra_test_dir, os.path.join(test_dir, options.extra_test_name))
         # register extra_test for testing in CTestTestfile.cmake
         with open(os.path.join(test_dir, "CTestTestfile.cmake"), "ab") as f:
-            f.write("SUBDIRS(%s)\n"%options.extra_test_name)
+            aStr = "SUBDIRS(%s)\n" % options.extra_test_name
+            f.write(aStr.encode())
     else:
         if verbose:
             print(extra_test_dir, " doesn't exist")