[Skencil-commits] r787 - skencil/branches/skencil-0.6

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Nov 22 13:57:28 CET 2010


Author: igor_n
Date: 2010-11-22 13:57:27 +0100 (Mon, 22 Nov 2010)
New Revision: 787

Modified:
   skencil/branches/skencil-0.6/setup.py
Log:
fixes for script consistency

Modified: skencil/branches/skencil-0.6/setup.py
===================================================================
--- skencil/branches/skencil-0.6/setup.py	2010-11-22 11:51:53 UTC (rev 786)
+++ skencil/branches/skencil-0.6/setup.py	2010-11-22 12:57:27 UTC (rev 787)
@@ -147,27 +147,24 @@
 ############################################################
 
 if __name__ == "__main__":
-    
-    if len(sys.argv) > 1 and sys.argv[1] == 'build_locales':
-        generate_locales()
-        sys.exit(0)
         
-    if len(sys.argv) > 1 and sys.argv[1] == 'build&copy':
-        COPY = True
-        sys.argv[1] = 'build'
-        generate_locales()
+    if len(sys.argv) > 1:    
         
-    if len(sys.argv) > 1 and sys.argv[1] == 'bdist_deb':
-        DEBIAN = True
-        sys.argv[1] = 'build'
-        generate_locales()        
+        if sys.argv[1] == 'build_locales':
+            generate_locales()
+            sys.exit(0)
+            
+        if sys.argv[1] == 'build_and_copy':
+            COPY = True
+            sys.argv[1] = 'build'
+            
+        if sys.argv[1] == 'bdist_deb':
+            DEBIAN = True
+            sys.argv[1] = 'build'
+
+        if sys.argv[1] in ['bdist_deb', 'bdist_rpm', 'build_and_copy']:    
+            generate_locales()
         
-    if len(sys.argv) > 1 and sys.argv[1] == 'bdist_rpm':
-        generate_locales()
-        
-    if len(sys.argv) > 1 and not sys.argv[1] == 'sdist':    
-        generate_locales()
-        
     dirs = get_dirs_tree('src/Resources/Messages')
     messages_dirs = []
     for item in dirs:
@@ -212,33 +209,36 @@
                         ('MINOR_VERSION', '6')],
             include_dirs=[filter_src],
             sources=[pstokenize_src + 'pstokenize.c', pstokenize_src + 'pschartab.c'])
-
-
-    #Fix for Debian based distros
+    
+    
     tcl_include_dirs = []
     tcl_ver = ''
-    if os.path.isdir('/usr/include/tcl8.5'):
-        tcl_include_dirs = ['/usr/include/tcl8.5']
-        tcl_ver = '8.5'
+    
+    if len(sys.argv) > 1 and sys.argv[1] in ['bdist_deb', 'bdist_rpm', 'build_and_copy', 'build', 'install']:  
         
-    if os.path.isdir('/usr/include/tcl8.6'):
-        tcl_include_dirs = ['/usr/include/tcl8.6']
-        tcl_ver = '8.6'
-    
-    #Fix for OpenSuse
-    if not tcl_ver:
-        if os.path.isfile('/usr/lib/libtcl8.5.so'):
+        #Fix for Debian based distros
+        if os.path.isdir('/usr/include/tcl8.5'):
+            tcl_include_dirs = ['/usr/include/tcl8.5']
             tcl_ver = '8.5'
-        if os.path.isfile('/usr/lib64/libtcl8.5.so'):
-            tcl_ver = '8.5'
-        if os.path.isfile('/usr/lib/libtcl8.6.so'):
+            
+        if os.path.isdir('/usr/include/tcl8.6'):
+            tcl_include_dirs = ['/usr/include/tcl8.6']
             tcl_ver = '8.6'
-        if os.path.isfile('/usr/lib64/libtcl8.6.so'):
-            tcl_ver = '8.6'
-            
-    if not tcl_ver:
-        print 'System tcl/tk =>8.5 libraries have not found!'
-        sys.exit(1)
+        
+        #Fix for OpenSuse
+        if not tcl_ver:
+            if os.path.isfile('/usr/lib/libtcl8.5.so'):
+                tcl_ver = '8.5'
+            if os.path.isfile('/usr/lib64/libtcl8.5.so'):
+                tcl_ver = '8.5'
+            if os.path.isfile('/usr/lib/libtcl8.6.so'):
+                tcl_ver = '8.6'
+            if os.path.isfile('/usr/lib64/libtcl8.6.so'):
+                tcl_ver = '8.6'
+                
+        if not tcl_ver:
+            print 'System tcl/tk =>8.5 libraries have not found!'
+            sys.exit(1)
     
     
     paxtkinter_src = src_path + 'extensions/Pax/'                



More information about the Skencil-commits mailing list