aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-10-07 13:23:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-10-07 13:23:57 +0300
commitdbf982e9994db49a3a6645a2a0cf79656a0d9b34 (patch)
tree4da6ebab41625d88292c48b50a5ccf66a6422211
parent9f936067f5eb65b2f45f8be0546eb1f975c8aae0 (diff)
Fix loader to add base repository manifest implicitly if repositories.manifest contains no repository manifests
-rw-r--r--load/load.cxx3
-rw-r--r--tests/load/1/misc/packages.manifest4
2 files changed, 5 insertions, 2 deletions
diff --git a/load/load.cxx b/load/load.cxx
index 16bdd40..3408284 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -667,6 +667,9 @@ load_repositories (const options& lo,
manifest_parser mp (ifs, p.string ());
rpm = pkg_repository_manifests (mp, ignore_unknown);
+
+ if (rpm.empty ())
+ rpm.emplace_back (repository_manifest ()); // Add the base repository.
}
catch (const io_error& e)
{
diff --git a/tests/load/1/misc/packages.manifest b/tests/load/1/misc/packages.manifest
index f02ce01..b019920 100644
--- a/tests/load/1/misc/packages.manifest
+++ b/tests/load/1/misc/packages.manifest
@@ -25,7 +25,7 @@ license: MIT
url: http://www.example.com/foo/
email: foo-users@example.com
location: libfoo-1.0.tar.gz
-sha256sum: 754cba3da34dd0296866027a26b6bacf08cacc80f54516d3b8d8eeccbe31ab93
+sha256sum: e89c6d746f8b1ea3ec58d294946d2f683d133438d2ac8c88549ba24c19627e76
:
name: libfoo
version: 0.1
@@ -43,7 +43,7 @@ license: MIT
url: http://www.example.com/foo/
email: foo-users@example.com
location: libfoo-1.2.4+1.tar.gz
-sha256sum: 35ccba3da34dd0296866027a26b6bacf08cacc80f54516d3b8d8eeccbe31ab93
+sha256sum: 6692a487e0908598e36bdeb9c25ed1e4a35bb99587dbc475807d314fa0719ac6
:
name: libfoo
version: 1.2.4+2