diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-18 15:31:10 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-21 18:06:52 -0700 |
| commit | 6350eddd4689568ff8dcfe431e1bf81579fb0556 (patch) | |
| tree | e8912dcfcb7e833cf9626afa808cdf2eab5af485 /toolsrc/src/commands_export.cpp | |
| parent | 989083caacfe44e442a88db851ded8e2b519c143 (diff) | |
| download | vcpkg-6350eddd4689568ff8dcfe431e1bf81579fb0556.tar.gz vcpkg-6350eddd4689568ff8dcfe431e1bf81579fb0556.zip | |
Find group_by_plan_type outside of print_plan()
Diffstat (limited to 'toolsrc/src/commands_export.cpp')
| -rw-r--r-- | toolsrc/src/commands_export.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/toolsrc/src/commands_export.cpp b/toolsrc/src/commands_export.cpp index efd12b836..018c6d636 100644 --- a/toolsrc/src/commands_export.cpp +++ b/toolsrc/src/commands_export.cpp @@ -14,13 +14,10 @@ namespace vcpkg::Commands::Export using Dependencies::RequestType; using Dependencies::ExportPlanType; - static void print_plan(const std::vector<ExportPlanAction>& plan) + static void print_plan(const std::map<ExportPlanType, std::vector<const ExportPlanAction*>>& group_by_plan_type) { static constexpr std::array<ExportPlanType, 2> order = { ExportPlanType::ALREADY_BUILT, ExportPlanType::PORT_AVAILABLE_BUT_NOT_BUILT }; - std::map<ExportPlanType, std::vector<const ExportPlanAction*>> group_by_plan_type; - Util::group_by(plan, &group_by_plan_type, [](const ExportPlanAction& p) { return p.plan_type; }); - for (const ExportPlanType plan_type : order) { auto it = group_by_plan_type.find(plan_type); @@ -72,7 +69,9 @@ namespace vcpkg::Commands::Export std::vector<ExportPlanAction> export_plan = Dependencies::create_export_plan(paths, specs, status_db); Checks::check_exit(VCPKG_LINE_INFO, !export_plan.empty(), "Export plan cannot be empty"); - print_plan(export_plan); + std::map<ExportPlanType, std::vector<const ExportPlanAction*>> group_by_plan_type; + Util::group_by(export_plan, &group_by_plan_type, [](const ExportPlanAction& p) { return p.plan_type; }); + print_plan(group_by_plan_type); const bool has_non_user_requested_packages = std::find_if(export_plan.cbegin(), export_plan.cend(), [](const ExportPlanAction& package)-> bool { @@ -93,7 +92,7 @@ namespace vcpkg::Commands::Export const fs::path output = paths.root / "exported"; std::error_code ec; fs.remove_all(output, ec); - paths.get_filesystem().create_directory(output, ec); + fs.create_directory(output, ec); // execute the plan for (const ExportPlanAction& action : export_plan) |
