def dpkg_search_for_binutils(arch, util):
 packages = []
 try:
  filename = ('bin/%s*linux*-%s' % (arch, util))
  output = subprocess.check_output(['dpkg', '-S', filename])
  for line in output.strip().splitlines():
   (package, path) = line.split(':', 1)
   packages.append(package)
 except OSError:
  pass
 except subprocess.CalledProcessError:
  pass
 return packages

def dpkg_search_for_binutils ( arch , util ) : packages = [ ] try : filename = ( 'bin/%s*linux*-%s' % ( arch , util ) ) output = subprocess . check_output ( [ 'dpkg' , '-S' , filename ] ) for line in output . strip ( ) . splitlines ( ) : ( package , path ) = line . split ( ':' , 1 ) packages . append ( package ) except OSError : pass except subprocess . CalledProcessError : pass return packages
use dpkg to search for any available assemblers which will work .