[M5+] drop curated linkdb JSON; SQLite overlay is the single source

This commit is contained in:
2026-05-13 23:28:36 +00:00
parent 5db915e576
commit 653b9fbb8d
12 changed files with 193 additions and 656 deletions

View File

@@ -47,18 +47,17 @@ TEST_CASE("add_manual then resolve returns the manual recipe",
REQUIRE(got->source == "manual");
}
TEST_CASE("manual entry overrides curated for the same package",
"[linkdb][overlay]") {
TEST_CASE("manual entry resolves on subsequent open", "[linkdb][overlay]") {
auto db = Database::open(fresh_overlay());
REQUIRE(db.has_value());
Recipe override_r{
Recipe r{
.nixpkgs_attr = "fmt_pinned",
.find_package = "fmt CONFIG REQUIRED",
.targets = {"fmt::fmt"},
.source = "manual",
};
REQUIRE(db->add_manual("fmt", ">=10.0.0", override_r).has_value());
REQUIRE(db->add_manual("fmt", ">=10.0.0", r).has_value());
auto got = db->resolve("fmt", "10.2.0");
REQUIRE(got.has_value());
@@ -79,13 +78,10 @@ TEST_CASE("manual entry is constrained by version_range",
};
REQUIRE(db->add_manual("fmt", ">=11.0.0", r).has_value());
// 10.x falls outside the manual range and falls through to curated
auto curated = db->resolve("fmt", "10.2.0");
REQUIRE(curated.has_value());
REQUIRE(curated->source == "curated");
REQUIRE(curated->nixpkgs_attr == "fmt_10");
auto miss = db->resolve("fmt", "10.2.0");
REQUIRE_FALSE(miss.has_value());
REQUIRE(miss.error().code == ErrorCode::LinkdbUnknownPackage);
// 11.x matches the manual range
auto manual = db->resolve("fmt", "11.0.0");
REQUIRE(manual.has_value());
REQUIRE(manual->source == "manual");