Changeset 5867

Show
Ignore:
Timestamp:
08/31/10 13:45:47 (3 years ago)
Author:
ganja
Message:

Dependency detection done, using errors returned on compilation. Can change in class if required an have more elegent way to do so

Location:
packet-manipulator/branches/BTSniffer_ganja
Files:
1 removed
2 modified

Legend:

Unmodified
Added
Removed
  • packet-manipulator/branches/BTSniffer_ganja/BTSniffer/btcompile.py

    r5866 r5867  
    4040     
    4141    def gcc(self):#check if gcc is present 
     42        proc = subprocess.Popen('which gcc', 
     43                                shell=True, 
     44                                stdout=subprocess.PIPE 
     45                               )       
     46        if len(proc.communicate()[0])==0: 
     47            print "gcc" 
     48            return False             
    4249        return True 
    43  
    44     def python_dev(self): 
    45         proc = subprocess.Popen('gcc ' + self.python_dev_file, 
    46                                     shell=True, 
    47                                     stderr=subprocess.PIPE 
    48                                    ) 
    49         # Need to pass -I/usr/include/python2.6 as compile time argument, find better way 
    50         for dep in self.python_deps: 
    51             print dep 
    52         return False 
    5350 
    5451    def blue_dev(self): 
     
    6764    def make(self): 
    6865        if self.gcc(): 
    69             blue_check=self.blue_dev() 
    70             python_check=self.python_dev() 
    71          
    72             if blue_check or python_check: 
     66            if not self.blue_dev(): 
    7367                return False 
    7468 
    7569            #Compile and copy the C files for BTSniffer to PATH_BT_BACKEND 
    76             os.system(self.CMD_BUILD) 
     70            proc = subprocess.Popen(self.CMD_BUILD, 
     71                                    shell=True, 
     72                                    stderr=subprocess.PIPE 
     73                                   ) 
     74            check=proc.communicate()[1] 
     75         
     76            if re.search('[eE][rR][rR][oO][rR]',check) is not None : 
     77                for dep in self.python_deps: 
     78                    print dep 
     79                return False 
     80 
    7781            if os.path.exists(self.PATH_BT_BACKEND): 
    7882                shutil.rmtree(self.PATH_BT_BACKEND)         
     
    8589            shutil.copytree('btpincrack-v0.3',self.PATH_BT_PINCRACK) 
    8690 
     91            return True 
     92 
    8793        else: 
    8894            return False 
    8995 
    90 #btcompile().make() 
  • packet-manipulator/branches/BTSniffer_ganja/setup.py

    r5866 r5867  
    211211                PACKAGE_DATA['umit.pm.backend.bt_sniffer'] = ['*.so'] 
    212212 
    213                 of.chdir('../') 
     213                os.chdir('../') 
    214214 
    215215            else: