aboutsummaryrefslogtreecommitdiff
path: root/load
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-11-28 10:18:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-06 13:49:52 +0300
commit0d4ea3bf50f3addb239ff8998c05fa4b367c6c9f (patch)
tree57b5e4d16f3243e50932eaf5c2f2b0d021148ee2 /load
parent9d50600f7ca9f900f8bfdcd30668c7ee47b2c176 (diff)
Make sure we only build one package config per interactive tennant
Diffstat (limited to 'load')
-rw-r--r--load/load.cxx28
1 files changed, 18 insertions, 10 deletions
diff --git a/load/load.cxx b/load/load.cxx
index 000743c..ed48910 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -368,7 +368,8 @@ load_packages (const shared_ptr<repository>& rp,
const repository_location& cl,
database& db,
bool ignore_unknown,
- const manifest_name_values& overrides)
+ const manifest_name_values& overrides,
+ const string& overrides_name)
{
// packages_timestamp other than timestamp_nonexistent signals the
// repository packages are already loaded.
@@ -434,15 +435,17 @@ load_packages (const shared_ptr<repository>& rp,
{
if (rp->internal)
{
+ if (!overrides.empty ())
try
{
- pm.override (overrides, "" /* name */);
+ pm.override (overrides, overrides_name);
}
- catch (const manifest_parsing&)
+ catch (const manifest_parsing& e)
{
- // Overrides are already validated (see below).
- //
- assert (false);
+ cerr << "error: unable to override " << p << " manifest: " << e
+ << endl;
+
+ throw failed ();
}
// Create internal package object.
@@ -580,8 +583,7 @@ load_packages (const shared_ptr<repository>& rp,
move (ts),
move (pm.builds),
move (pm.build_constraints),
- build_package_configs (make_move_iterator (pm.build_configs.begin ()),
- make_move_iterator (pm.build_configs.end ())),
+ move (pm.build_configs),
move (pm.location),
move (pm.fragment),
move (pm.sha256sum),
@@ -979,7 +981,8 @@ load_repositories (const options& lo,
!pr->cache_location.empty () ? pr->cache_location : cl,
db,
ignore_unknown,
- manifest_name_values () /* overrides */);
+ manifest_name_values () /* overrides */,
+ "" /* overrides_name */);
load_repositories (lo,
pr,
@@ -1453,6 +1456,10 @@ try
// Parse and validate overrides, if specified.
//
+ // Note that here we make sure that the overrides manifest is valid.
+ // Applying overrides to a specific package manifest may still fail (see
+ // package_manifest::validate_overrides() for details).
+ //
manifest_name_values overrides;
if (ops.overrides_file_specified ())
@@ -1579,7 +1586,8 @@ try
r->cache_location,
db,
ops.ignore_unknown (),
- overrides);
+ overrides,
+ ops.overrides_file ().string ());
}
// On the second pass over the internal repositories we load their