diff --git a/src/libfetchers/include/nix/fetchers/registry.hh b/src/libfetchers/include/nix/fetchers/registry.hh index efbfe07c8..d7706bd75 100644 --- a/src/libfetchers/include/nix/fetchers/registry.hh +++ b/src/libfetchers/include/nix/fetchers/registry.hh @@ -45,7 +45,8 @@ struct Registry void add( const Input & from, const Input & to, - const Attrs & extraAttrs); + const Attrs & extraAttrs, + bool exact); void remove(const Input & input); }; diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc index 335935f53..54bde49c6 100644 --- a/src/libfetchers/registry.cc +++ b/src/libfetchers/registry.cc @@ -84,13 +84,15 @@ void Registry::write(const Path & path) void Registry::add( const Input & from, const Input & to, - const Attrs & extraAttrs) + const Attrs & extraAttrs, + bool exact) { entries.emplace_back( Entry { .from = from, .to = to, - .extraAttrs = extraAttrs + .extraAttrs = extraAttrs, + .exact = exact }); } @@ -144,7 +146,7 @@ void overrideRegistry( const Input & to, const Attrs & extraAttrs) { - getFlagRegistry(*from.settings)->add(from, to, extraAttrs); + getFlagRegistry(*from.settings)->add(from, to, extraAttrs, false); } static std::shared_ptr getGlobalRegistry(const Settings & settings, ref store) diff --git a/src/nix/registry.cc b/src/nix/registry.cc index 340d10ec4..7de795922 100644 --- a/src/nix/registry.cc +++ b/src/nix/registry.cc @@ -115,7 +115,7 @@ struct CmdRegistryAdd : MixEvalArgs, Command, RegistryCommand fetchers::Attrs extraAttrs; if (toRef.subdir != "") extraAttrs["dir"] = toRef.subdir; registry->remove(fromRef.input); - registry->add(fromRef.input, toRef.input, extraAttrs); + registry->add(fromRef.input, toRef.input, extraAttrs, false); registry->write(getRegistryPath()); } }; @@ -193,7 +193,7 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand warn("flake '%s' is not locked", resolved.to_string()); fetchers::Attrs extraAttrs; if (ref.subdir != "") extraAttrs["dir"] = ref.subdir; - registry->add(ref.input, resolved, extraAttrs); + registry->add(ref.input, resolved, extraAttrs, true); registry->write(getRegistryPath()); } };