parameters: (build_dir, dependencies)
return_statement: return filter(is_exe, map(filter_item, dependencies))
docstring: Processes the dependency list with OS specific rules.
docstring_summary: Processes the dependency list with OS specific rules.
docstring_tokens: Processes the dependency list with OS specific rules .
function: def post_process_deps(build_dir, dependencies):
    """Processes the dependency list with OS specific rules."""
    def filter_item(i):
      if i.endswith('.so.TOC'):
        # Remove only the suffix .TOC, not the .so!
        return i[:-4]
      if i.endswith('.dylib.TOC'):
        # Remove only the suffix .TOC, not the .dylib!
        return i[:-4]
      if i.endswith('.dll.lib'):
        # Remove only the suffix .lib, not the .dll!
        return i[:-4]
      return i
  
    def is_exe(i):
      # This script is only for adding new binaries that are created as part of
      # the component build.
      ext = os.path.splitext(i)[1]
      # On POSIX, executables have no extension.
      if ext not in ('', '.dll', '.dylib', '.exe', '.nexe', '.so'):
        return False
      if os.path.isabs(i):
        # In some rare case, there's dependency set explicitly on files outside
        # the checkout.
        return False
  
      # Check for execute access and strip directories. This gets rid of all the
      # phony rules.
      p = os.path.join(build_dir, i)
      return os.access(p, os.X_OK) and not os.path.isdir(p)
  
    return filter(is_exe, map(filter_item, dependencies))
function_tokens: def post_process_deps ( build_dir , dependencies ) : def filter_item ( i ) : if i . endswith ( '.so.TOC' ) : # Remove only the suffix .TOC, not the .so! return i [ : - 4 ] if i . endswith ( '.dylib.TOC' ) : # Remove only the suffix .TOC, not the .dylib! return i [ : - 4 ] if i . endswith ( '.dll.lib' ) : # Remove only the suffix .lib, not the .dll! return i [ : - 4 ] return i def is_exe ( i ) : # This script is only for adding new binaries that are created as part of # the component build. ext = os . path . splitext ( i ) [ 1 ] # On POSIX, executables have no extension. if ext not in ( '' , '.dll' , '.dylib' , '.exe' , '.nexe' , '.so' ) : return False if os . path . isabs ( i ) : # In some rare case, there's dependency set explicitly on files outside # the checkout. return False # Check for execute access and strip directories. This gets rid of all the # phony rules. p = os . path . join ( build_dir , i ) return os . access ( p , os . X_OK ) and not os . path . isdir ( p ) return filter ( is_exe , map ( filter_item , dependencies ) )