On Wed, 17 Feb 2010 11:59:25 -0300
Andres Riancho <[email protected]> wrote:

> > One could also check if /etc/debian_version exists and print
> > Debian-line automatically.
> 
>     This one I did not understand. Could you please elaborate?

Do you get my point from this:
http://paste.nerv.fi/77011988-w3af-dependencyCheck-patch.txt

---
Henri Salo
fg...@foo:~/w3af$ svn up && svn diff
At revision 3393.
Index: core/ui/gtkUi/dependencyCheck.py
===================================================================
--- core/ui/gtkUi/dependencyCheck.py(revision 3393)
+++ core/ui/gtkUi/dependencyCheck.py(working copy)
@@ -21,8 +21,8 @@
 '''
 
 import core.controllers.outputManager as om
-import sys
-import subprocess
+import sys, subprocess, os
+from os.path import exists
 
 def gtkui_dependency_check():
     '''
@@ -30,12 +30,18 @@
     '''
     om.out.debug('Checking GTK UI dependencies')
 
+    is_debian = 0
+    if os.path.exists("/etc/debian_version"):
+        is_debian = 1
+
     try:
         import sqlite3
     except:
         msg = 'You have to install python sqlite3 library. \n'
-        msg += '    - On Debian based distributions: apt-get install 
python-pysqlite2\n'
-        msg += '    - On Mac: sudo port install py25-sqlite3'        
+        if is_debian == 1:
+            msg += '    - On Debian based distributions: sudo aptitude install 
python-pysqlite2'
+        else:
+            msg += '    - On Mac: sudo port install py25-sqlite3'        
         print msg
         sys.exit( 1 )
 
@@ -43,15 +49,19 @@
         proc = subprocess.Popen('neato -V',shell=True, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
     except:
         msg = 'You have to install graphviz library. \n'
-        msg += '    - On Debian based distributions: apt-get install 
graphviz\n'
-        msg += '    - On Mac: sudo port install graphviz'        
+        if is_debian == 1:
+            msg += '    - On Debian based distributions: sudo aptitude install 
graphviz'
+        else:
+            msg += '    - On Mac: sudo port install graphviz'        
         print msg        
         sys.exit( 1 )
     else:
         if 'graphviz' not in proc.stderr.read().lower():
             msg = 'You have to install graphviz library. \n'
-            msg += '    - On Debian based distributions: apt-get install 
graphviz\n'
-            msg += '    - On Mac: sudo port install graphviz'        
+            if is_debian == 1:
+                msg += '    - On Debian based distributions: sudo aptitude 
install graphviz'
+            else:
+                msg += '    - On Mac: sudo port install graphviz'        
             print msg
             sys.exit( 1 )
 
@@ -63,8 +73,10 @@
         assert gtk.pygtk_version >= (2, 12)
     except:
         msg = 'You have to install GTK and PyGTK versions >=2.12 to be able to 
run the GTK user interface.\n'
-        msg += '    - On Debian based distributions: apt-get install 
python-gtk2\n'
-        msg += '    - On Mac: sudo port install py25-gtk'        
+        if is_debian == 1:
+            msg += '    - On Debian based distributions: sudo aptitude install 
python-gtk2'
+        else:
+            msg += '    - On Mac: sudo port install py25-gtk'        
         print msg
         sys.exit( 1 )
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
W3af-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/w3af-users

Reply via email to