@utils.memoize
def get_pkgfile(command):
 try:
  command = command.strip()
  if command.startswith('sudo '):
   command = command[5:]
  command = command.split(' ')[0]
  packages = subprocess.check_output(['pkgfile', '-b', '-v', command], universal_newlines=True, stderr=utils.DEVNULL).splitlines()
  return [package.split()[0] for package in packages]
 except subprocess.CalledProcessError:
  return None

@ utils . memoize def get_pkgfile ( command ) : try : command = command . strip ( ) if command . startswith ( 'sudo ' ) : command = command [ 5 : ] command = command . split ( ' ' ) [ 0 ] packages = subprocess . check_output ( [ 'pkgfile' , '-b' , '-v' , command ] , universal_newlines = True , stderr = utils . DEVNULL ) . splitlines ( ) return [ package . split ( ) [ 0 ] for package in packages ] except subprocess . CalledProcessError : return None
gets the packages that provide the given command using pkgfile .