From d2bab3c370fca9fa5216d97495810faaeeaebc2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Mar 2017 10:46:49 -0700 Subject: Rework Paragraph parsing error handling. Add single paragraph functions --- toolsrc/src/commands_import.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/src/commands_import.cpp') diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 69710765f..6be5c2fe1 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -72,11 +72,11 @@ namespace vcpkg::Commands::Import const fs::path include_directory(args.command_arguments[1]); const fs::path project_directory(args.command_arguments[2]); - auto pghs = Paragraphs::get_paragraphs(control_file_path); - Checks::check_exit(VCPKG_LINE_INFO, pghs.size() == 1, "Invalid control file %s for package", control_file_path.generic_string()); + const expected> pghs = Paragraphs::get_single_paragraph(control_file_path); + Checks::check_exit(VCPKG_LINE_INFO, pghs.get() != nullptr, "Invalid control file %s for package", control_file_path.generic_string()); StatusParagraph spgh; - spgh.package = BinaryParagraph(pghs[0]); + spgh.package = BinaryParagraph(*pghs.get()); auto& control_file_data = spgh.package; do_import(paths, include_directory, project_directory, control_file_data); -- cgit v1.2.3