Salome HOME
Prepare SALOME 2.2.6 installation
[tools/install.git] / runInstall
index 367320d94b47bd635ba8e8da215e1b25c55f68e3..d3d2725a73206617ef4bc7cddfa7d693f88e475f 100755 (executable)
@@ -1,5 +1,8 @@
 #!/usr/bin/env python
 
+import warnings
+warnings.filterwarnings("ignore", "", DeprecationWarning)
+
 import xmllib
 import sys, os, string, re
 
@@ -484,16 +487,23 @@ if __name__ == "__main__":
     # define xml file -----------------
     if (xml_file is None) :
         xml_file_name = "config.xml"
-        if os.path.exists("/proc/version"):
-            data = open("/proc/version").readline()
-            res = re.search(r'Red\s+Hat\s+\w+(\s+)?(\d[.]\d)', data)
+        if os.path.exists("/etc/redhat-release"):
+            data = open("/etc/redhat-release").readline()
+            res = re.search(r'Red\s+Hat\s+Linux\s+release\s+([\d.]*)', data)
             if res is not None:
-                num = re.sub("[.]", "_", (res.groups())[1])
+                num = re.sub("[.]", "_", (res.groups())[0])
                 filename = "config_RedHat" + num+ ".xml"
                 if (os.path.exists(cur_dir + filename)):
                     xml_file_name = filename
-                
+            else:
+                res = re.search(r'Mandrakelinux\s+release\s+([\d.]*)', data)
+                if res is not None:
+                    num = re.sub("[.]", "_", (res.groups())[0])
+                    filename = "config_Mandrake" + num+ ".xml"
+                    if (os.path.exists(cur_dir + filename)):
+                        xml_file_name = filename
         xml_file = cur_dir +  xml_file_name
+
     if xml_file is None or not os.path.exists(xml_file):
         error_exit("No xml file is found, try to run with options -f <xmlfile>")