mirror of
https://github.com/NixOS/nix.git
synced 2024-11-29 10:12:28 +00:00
Merge pull request #10150 from edolstra/always-upgrade-unlocked-flakerefs
nix profile upgrade: Always upgrade unlocked flakerefs
This commit is contained in:
commit
bd828b1937
@ -219,6 +219,8 @@ struct CmdFlakeMetadata : FlakeCommand, MixJSON
|
||||
j["resolvedUrl"] = flake.resolvedRef.to_string();
|
||||
j["resolved"] = fetchers::attrsToJSON(flake.resolvedRef.toAttrs());
|
||||
j["url"] = flake.lockedRef.to_string(); // FIXME: rename to lockedUrl
|
||||
// "locked" is a misnomer - this is the result of the
|
||||
// attempt to lock.
|
||||
j["locked"] = fetchers::attrsToJSON(flake.lockedRef.toAttrs());
|
||||
if (auto rev = flake.lockedRef.input.getRev())
|
||||
j["revision"] = rev->to_string(HashFormat::Base16, false);
|
||||
@ -235,6 +237,7 @@ struct CmdFlakeMetadata : FlakeCommand, MixJSON
|
||||
logger->cout(
|
||||
ANSI_BOLD "Resolved URL:" ANSI_NORMAL " %s",
|
||||
flake.resolvedRef.to_string());
|
||||
if (flake.lockedRef.input.isLocked())
|
||||
logger->cout(
|
||||
ANSI_BOLD "Locked URL:" ANSI_NORMAL " %s",
|
||||
flake.lockedRef.to_string());
|
||||
|
@ -650,7 +650,9 @@ struct CmdProfileUpgrade : virtual SourceExprCommand, MixDefaultProfile, MixProf
|
||||
assert(infop);
|
||||
auto & info = *infop;
|
||||
|
||||
if (element.source->lockedRef == info.flake.lockedRef) continue;
|
||||
if (info.flake.lockedRef.input.isLocked()
|
||||
&& element.source->lockedRef == info.flake.lockedRef)
|
||||
continue;
|
||||
|
||||
printInfo("upgrading '%s' from flake '%s' to '%s'",
|
||||
element.source->attrPath, element.source->lockedRef, info.flake.lockedRef);
|
||||
|
Loading…
Reference in New Issue
Block a user