aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg_Dependencies.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-17 02:39:14 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-06-20 09:36:21 -0700
commit8741214bf69d1209a1e6d405ed8561d27f04436a (patch)
tree85325eb4b2d2c1c15eb8bd58426dac5462242d4e /toolsrc/src/vcpkg_Dependencies.cpp
parent8c4d55b8f304c74aeb95878cfe354830ff4abc88 (diff)
downloadvcpkg-8741214bf69d1209a1e6d405ed8561d27f04436a.tar.gz
vcpkg-8741214bf69d1209a1e6d405ed8561d27f04436a.zip
[vcpkg] Use unique_ptr<> for paragraphs. Post-parser phase rework.
Diffstat (limited to 'toolsrc/src/vcpkg_Dependencies.cpp')
-rw-r--r--toolsrc/src/vcpkg_Dependencies.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp
index add8acb4d..bbf807c95 100644
--- a/toolsrc/src/vcpkg_Dependencies.cpp
+++ b/toolsrc/src/vcpkg_Dependencies.cpp
@@ -174,12 +174,11 @@ namespace vcpkg::Dependencies
if (auto bpgh = maybe_bpgh.get())
return InstallPlanAction{spec, {nullopt, *bpgh, nullopt}, request_type};
- ExpectedT<SourceControlFile, ParseControlErrorInfo> source_control_file =
- Paragraphs::try_load_port(paths.get_filesystem(), paths.port_dir(spec));
- if (auto scf = source_control_file.get())
- return InstallPlanAction{spec, {nullopt, nullopt, (*scf).core_paragraph}, request_type};
+ auto maybe_scf = Paragraphs::try_load_port(paths.get_filesystem(), paths.port_dir(spec));
+ if (auto scf = maybe_scf.get())
+ return InstallPlanAction{spec, {nullopt, nullopt, *scf->get()->core_paragraph}, request_type};
- print_error_message(source_control_file.error());
+ print_error_message(maybe_scf.error());
Checks::exit_fail(VCPKG_LINE_INFO);
}
};
@@ -284,13 +283,11 @@ namespace vcpkg::Dependencies
if (auto bpgh = maybe_bpgh.get())
return ExportPlanAction{spec, {nullopt, *bpgh, nullopt}, request_type};
- ExpectedT<SourceControlFile, ParseControlErrorInfo> source_control_file =
- Paragraphs::try_load_port(paths.get_filesystem(), paths.port_dir(spec));
- if (auto scf = source_control_file.get())
- return ExportPlanAction{spec, {nullopt, nullopt, (*scf).core_paragraph}, request_type};
-
+ auto maybe_scf = Paragraphs::try_load_port(paths.get_filesystem(), paths.port_dir(spec));
+ if (auto scf = maybe_scf.get())
+ return ExportPlanAction{spec, {nullopt, nullopt, *scf->get()->core_paragraph}, request_type};
else
- print_error_message(source_control_file.error());
+ print_error_message(maybe_scf.error());
Checks::exit_with_message(VCPKG_LINE_INFO, "Could not find package %s", spec);
}