install.py

changeset 565
21191e634b47
parent 564
b3d966393ba9
child 615
c8dd16cc69ce
--- a/install.py	Sat Sep 04 19:51:48 2010 +0200
+++ b/install.py	Sun Sep 05 13:36:40 2010 +0200
@@ -31,6 +31,13 @@
 cfg = {}
 progLanguages = ["Python", "Ruby"]
 
+# Define blacklisted versions of the prerequisites
+BlackLists = {
+    "sip"         : ["4.11"], 
+    "PyQt4"       : ["4.7.5"], 
+    "QScintilla2" : [], 
+}
+
 def exit(rcode = 0):
     """
     Exit the install script.
@@ -575,7 +582,23 @@
         exit(2)
     print("Qt Version: {0}".format(qVersion()))
     
-    #check version of PyQt
+    # check version of sip
+    try:
+        import sipconfig
+        sipVersion = sipconfig.Configuration().sip_version_str
+        # always assume, that snapshots are new enough
+        if "snapshot" not in sipVersion:
+            # check for blacklisted versions
+            for vers in BlackLists["sip"]:
+                if vers == sipVersion:
+                    print('Sorry, sip version {0} is not compatible with eric5.'\
+                          .format(vers))
+                    print('Please install another version.')
+                    exit(3)
+    except ImportError:
+        pass
+    
+    # check version of PyQt
     from PyQt4.QtCore import PYQT_VERSION_STR
     pyqtVersion = PYQT_VERSION_STR
     # always assume, that snapshots are new enough
@@ -589,10 +612,17 @@
         if maj < 4 or (maj == 4 and min < 7):
             print('Sorry, you must have PyQt 4.7.0 or higher or' \
                   ' a recent snapshot release.')
-            exit(3)
+            exit(4)
+        # check for blacklisted versions
+        for vers in BlackLists["PyQt4"]:
+            if vers == pyqtVersion:
+                print('Sorry, PyQt4 version {0} is not compatible with eric5.'\
+                      .format(vers))
+                print('Please install another version.')
+                exit(4)
     print("PyQt Version: ", pyqtVersion)
     
-    #check version of QScintilla
+    # check version of QScintilla
     from PyQt4.Qsci import QSCINTILLA_VERSION_STR
     scintillaVersion = QSCINTILLA_VERSION_STR
     # always assume, that snapshots are new enough
@@ -606,7 +636,14 @@
         if maj < 2 or (maj == 2 and min < 4):
             print('Sorry, you must have QScintilla 2.4.0 or higher or' \
                   ' a recent snapshot release.')
-            exit(4)
+            exit(5)
+        # check for blacklisted versions
+        for vers in BlackLists["QScintilla2"]:
+            if vers == scintillaVersion:
+                print('Sorry, QScintilla2 version {0} is not compatible with eric5.'\
+                      .format(vers))
+                print('Please install another version.')
+                exit(5)
     print("QScintilla Version: ", QSCINTILLA_VERSION_STR)
     print("All dependencies ok.")
     print()
@@ -845,4 +882,4 @@
         print("""An internal error occured.  Please report all the output of the program,
 including the following traceback, to eric5-bugs@eric-ide.python-projects.org.
 """)
-        raise
\ No newline at end of file
+        raise

eric ide

mercurial