aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-fetch.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-05-26 22:08:52 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-05-30 11:21:16 +0300
commit7a20c6dc511c39df0355f32ebeb89e16e8677834 (patch)
tree307483a1740a779d88955848796591b964b66360 /bpkg/rep-fetch.cxx
parent3381da9cdbe7d9516271154c765a369b70cf8f49 (diff)
Document package-description* and changes-type manifest values and adapt testscript to new values
Diffstat (limited to 'bpkg/rep-fetch.cxx')
-rw-r--r--bpkg/rep-fetch.cxx117
1 files changed, 69 insertions, 48 deletions
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<string>
- {
- // 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<string>
{
- 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<string>
- {
- // 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<string>
{
- // 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