'This function checks whether install succeeded.'

def sanity_check_prefix(self):

    def check_paths(path_list, filetype, predicate):
        if isinstance(path_list, string_types):
            path_list = [path_list]
        for path in path_list:
            abs_path = os.path.join(self.prefix, path)
            if (not predicate(abs_path)):
                raise InstallError(('Install    failed    for    %s.    No    such    %s    in    prefix:    %s' % (self.name, filetype, path)))
    check_paths(self.sanity_check_is_file, 'file', os.path.isfile)
    check_paths(self.sanity_check_is_dir, 'directory', os.path.isdir)
    installed = set(os.listdir(self.prefix))
    installed.difference_update(spack.store.layout.hidden_file_paths)
    if (not installed):
        raise InstallError(('Install    failed    for    %s.        Nothing    was    installed!' % self.name))
