From 7a20c6dc511c39df0355f32ebeb89e16e8677834 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 26 May 2023 22:08:52 +0300 Subject: Document package-description* and changes-type manifest values and adapt testscript to new values --- bpkg/rep-fetch.cxx | 117 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 48 deletions(-) (limited to 'bpkg/rep-fetch.cxx') diff --git a/bpkg/rep-fetch.cxx b/bpkg/rep-fetch.cxx index 17536da..6f31478 100644 --- a/bpkg/rep-fetch.cxx +++ b/bpkg/rep-fetch.cxx @@ -481,25 +481,35 @@ namespace bpkg // Load *-file values. // - m.load_files ( - [ev, &rd, &rl, &pl] - (const string& n, const path& p) -> optional - { - // Always expand the build-file values. - // - if (ev || n == "build-file") + try + { + m.load_files ( + [ev, &rd, &rl, &pl] + (const string& n, const path& p) -> optional { - return read_package_file (p, - n, - pl, - rd, - rl, - empty_string /* fragment */); - } - else - return nullopt; - }, - iu); + // Always expand the build-file values. + // + if (ev || n == "build-file") + { + return read_package_file (p, + n, + pl, + rd, + rl, + empty_string /* fragment */); + } + else + return nullopt; + }, + iu); + } + catch (const manifest_parsing& e) + { + diag_record dr (fail); + dr << e << info; + print_package_info (dr, pl, rl, nullopt /* fragment */); + dr << endf; + } // Load the bootstrap, root, and config/*.build buildfiles into the // respective *-build values, if requested and if they are not already @@ -679,38 +689,49 @@ namespace bpkg // Load *-file values. // - m.load_files ( - [ev, &td, &rl, &pl, &fr, &checkout_submodules] - (const string& n, const path& p) -> optional - { - // Always expand the build-file values. - // - if (ev || n == "build-file") + try + { + m.load_files ( + [ev, &td, &rl, &pl, &fr, &checkout_submodules] + (const string& n, const path& p) -> optional { - // Check out submodules if the referenced file doesn't exist. - // - // Note that this doesn't work for symlinks on Windows where - // git normally creates filesystem-agnostic symlinks that are - // indistinguishable from regular files (see fixup_worktree() - // for details). It seems like the only way to deal with that - // is to unconditionally checkout submodules on Windows. Let's - // not pessimize things for now (if someone really wants this - // to work, they can always enable real symlinks in git). + // Always expand the build-file values. // - if (!exists (td / pl / p)) - checkout_submodules (); - - return read_package_file (p, - n, - pl, - td, - rl, - fr.friendly_name); - } - else - return nullopt; - }, - iu); + if (ev || n == "build-file") + { + // Check out submodules if the referenced file doesn't exist. + // + // Note that this doesn't work for symlinks on Windows where + // git normally creates filesystem-agnostic symlinks that + // are indistinguishable from regular files (see + // fixup_worktree() for details). It seems like the only way + // to deal with that is to unconditionally checkout + // submodules on Windows. Let's not pessimize things for now + // (if someone really wants this to work, they can always + // enable real symlinks in git). + // + if (!exists (td / pl / p)) + checkout_submodules (); + + return read_package_file (p, + n, + pl, + td, + rl, + fr.friendly_name); + } + else + return nullopt; + }, + iu); + } + catch (const manifest_parsing& e) + { + diag_record dr (fail); + dr << e << info; + print_package_info (dr, pl, rl, fr.friendly_name); + dr << endf; + } // Load the bootstrap, root, and config/*.build buildfiles into the // respective *-build values, if requested and if they are not -- cgit v1.1