def check_manifest(source_tree='<STR_LIT:.>', create=False, update=False,<EOL>python=sys.executable):
all_ok = True<EOL>python = os.path.abspath(python)  <EOL>with cd(source_tree):<EOL><INDENT>if not is_package():<EOL><INDENT>raise Failure('<STR_LIT>')<EOL><DEDENT>read_config()<EOL>read_manifest()<EOL>info_begin("<STR_LIT>")<EOL>all_source_files = sorted(get_vcs_files())<EOL>source_files = strip_sdist_extras(all_source_files)<EOL>info_continue("<STR_LIT>" % len(source_files))<EOL>info_begin("<STR_LIT>")<EOL>with mkdtemp('<STR_LIT>') as tempdir:<EOL><INDENT>run([python, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', tempdir])<EOL>sdist_filename = get_one_file_in(tempdir)<EOL>info_continue("<STR_LIT>" % os.path.basename(sdist_filename))<EOL>sdist_files = sorted(normalize_names(strip_sdist_extras(<EOL>strip_toplevel_name(get_archive_file_list(sdist_filename)))))<EOL>info_continue("<STR_LIT>" % len(sdist_files))<EOL><DEDENT>existing_source_files = list(filter(os.path.exists, all_source_files))<EOL>missing_source_files = sorted(set(all_source_files) - set(existing_source_files))<EOL>if missing_source_files:<EOL><INDENT>warning("<STR_LIT>"<EOL>% format_list(missing_source_files))<EOL><DEDENT>info_begin("<STR_LIT>")<EOL>with mkdtemp('<STR_LIT>') as tempsourcedir:<EOL><INDENT>copy_files(existing_source_files, tempsourcedir)<EOL>if os.path.exists('<STR_LIT>') and '<STR_LIT>' not in source_files:<EOL><INDENT>copy_files(['<STR_LIT>'], tempsourcedir)<EOL><DEDENT>if '<STR_LIT>' not in source_files:<EOL><INDENT>copy_files(['<STR_LIT>'], tempsourcedir)<EOL><DEDENT>info_begin("<STR_LIT>")<EOL>with cd(tempsourcedir):<EOL><INDENT>with mkdtemp('<STR_LIT>') as tempdir:<EOL><INDENT>run([python, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', tempdir])<EOL>sdist_filename = get_one_file_in(tempdir)<EOL>info_continue("<STR_LIT>" % os.path.basename(sdist_filename))<EOL>clean_sdist_files = sorted(normalize_names(strip_sdist_extras(<EOL>strip_toplevel_name(get_archive_file_list(sdist_filename)))))<EOL>info_continue("<STR_LIT>" % len(clean_sdist_files))<EOL><DEDENT><DEDENT><DEDENT>missing_from_manifest = set(source_files) - set(clean_sdist_files)<EOL>missing_from_VCS = set(sdist_files + clean_sdist_files) - set(source_files)<EOL>if not missing_from_manifest and not missing_from_VCS:<EOL><INDENT>info("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>error("<STR_LIT>"<EOL>% format_missing(missing_from_VCS, missing_from_manifest,<EOL>"<STR_LIT>", "<STR_LIT>"))<EOL>suggestions, unknowns = find_suggestions(missing_from_manifest)<EOL>user_asked_for_help = update or (create and not<EOL>os.path.exists('<STR_LIT>'))<EOL>if '<STR_LIT>' not in existing_source_files:<EOL><INDENT>if suggestions and not user_asked_for_help:<EOL><INDENT>info("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>info("<STR_LIT>")<EOL><DEDENT><DEDENT>if suggestions:<EOL><INDENT>info("<STR_LIT>"<EOL>% format_list(suggestions))<EOL>if user_asked_for_help:<EOL><INDENT>existed = os.path.exists('<STR_LIT>')<EOL>with open('<STR_LIT>', '<STR_LIT:a>') as f:<EOL><INDENT>if not existed:<EOL><INDENT>info("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>info("<STR_LIT>")<EOL>f.write('<STR_LIT>')<EOL><DEDENT>f.write('<STR_LIT:\n>'.join(suggestions) + '<STR_LIT:\n>')<EOL><DEDENT>if unknowns:<EOL><INDENT>info("<STR_LIT>"<EOL>% format_list(unknowns))<EOL><DEDENT><DEDENT><DEDENT>elif user_asked_for_help:<EOL><INDENT>info("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>all_ok = False<EOL><DEDENT>bad_ideas = find_bad_ideas(all_source_files)<EOL>if bad_ideas:<EOL><INDENT>warning("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>% bad_ideas[<NUM_LIT:0>])<EOL>if len(bad_ideas) > <NUM_LIT:1>:<EOL><INDENT>warning("<STR_LIT>"<EOL>% format_list(bad_ideas[<NUM_LIT:1>:]))<EOL><DEDENT>all_ok = False<EOL><DEDENT><DEDENT>return all_ok<EOL>
Compare a generated source distribution with list of files in a VCS.

    Returns True if the manifest is fine.