[!] Change the format of the listfile

This commit is contained in:
Alexander Karatarakis 2017-02-15 19:19:19 -08:00
parent ad197b4a74
commit 293fcbec59
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ namespace vcpkg::Commands::Install
const std::string& target_triplet_as_string = target_triplet.canonical_name();
std::error_code ec;
fs::create_directory(paths.installed / target_triplet_as_string, ec);
output.push_back(Strings::format(R"(%s)", target_triplet_as_string));
output.push_back(Strings::format(R"(%s/)", target_triplet_as_string));
for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it)
{
@ -54,7 +54,7 @@ namespace vcpkg::Commands::Install
}
// Trailing backslash for directories
output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix));
output.push_back(Strings::format(R"(%s/%s/)", target_triplet_as_string, suffix));
continue;
}
@ -82,6 +82,8 @@ namespace vcpkg::Commands::Install
System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string());
}
std::sort(output.begin(), output.end());
Files::write_all_lines(paths.listfile_path(bpgh), output);
}

View File

@ -164,12 +164,10 @@ static void upgrade_to_slash_terminated_sorted_format(std::vector<std::string>*
// The new format is lexicographically sorted
std::sort(lines->begin(), lines->end());
#if 0
// Replace the listfile on disk
const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated";
Files::write_all_lines(updated_listfile_path, *lines);
fs::rename(updated_listfile_path, listfile_path);
#endif
}
std::vector<StatusParagraph_and_associated_files> vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db)