mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 09:19:36 +01:00
Fix registry pin ref lookup
This commit is contained in:
parent
94c3bb3e4c
commit
8642c0a9a2
1 changed files with 1 additions and 1 deletions
|
|
@ -189,7 +189,6 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
|
||||||
auto registry = getRegistry();
|
auto registry = getRegistry();
|
||||||
auto ref = parseFlakeRef(fetchSettings, url);
|
auto ref = parseFlakeRef(fetchSettings, url);
|
||||||
auto lockedRef = parseFlakeRef(fetchSettings, locked);
|
auto lockedRef = parseFlakeRef(fetchSettings, locked);
|
||||||
registry->remove(ref.input);
|
|
||||||
auto resolvedInput = lockedRef.resolve(fetchSettings, store).input;
|
auto resolvedInput = lockedRef.resolve(fetchSettings, store).input;
|
||||||
auto resolved = resolvedInput.getAccessor(fetchSettings, store).second;
|
auto resolved = resolvedInput.getAccessor(fetchSettings, store).second;
|
||||||
if (!resolved.isLocked(fetchSettings))
|
if (!resolved.isLocked(fetchSettings))
|
||||||
|
|
@ -197,6 +196,7 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
|
||||||
fetchers::Attrs extraAttrs;
|
fetchers::Attrs extraAttrs;
|
||||||
if (ref.subdir != "")
|
if (ref.subdir != "")
|
||||||
extraAttrs["dir"] = ref.subdir;
|
extraAttrs["dir"] = ref.subdir;
|
||||||
|
registry->remove(ref.input);
|
||||||
registry->add(ref.input, resolved, extraAttrs);
|
registry->add(ref.input, resolved, extraAttrs);
|
||||||
registry->write(getRegistryPath());
|
registry->write(getRegistryPath());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue