mirror of
https://github.com/NixOS/nix
synced 2025-07-07 10:11:47 +02:00
Implement alternative to lazy generations:
* only the last generation can be lazy * depend on the '--lazy-generation' flag to be set
This commit is contained in:
parent
3d83188702
commit
ea39c98d41
6 changed files with 39 additions and 21 deletions
|
@ -99,14 +99,24 @@ if nix-env -q '*' | grep -q bar; then false; fi
|
|||
nix-env --list-generations
|
||||
test "$(nix-env --list-generations | wc -l)" -eq 7
|
||||
|
||||
# Doing the same operation twice should result in the same generation, not an
|
||||
# additional one. At this point we just brought back foo. Installing it again
|
||||
# should not create a new generation.
|
||||
# Doing the same operation twice results in the same generation, but creates an
|
||||
# additional one. At this point we just brought back foo.
|
||||
|
||||
nix-env -i foo
|
||||
|
||||
# Count generations.
|
||||
nix-env --list-generations
|
||||
test "$(nix-env --list-generations | wc -l)" -eq 7
|
||||
test "$(nix-env --list-generations | wc -l)" -eq 8
|
||||
|
||||
# Now, doing that again but passing the --lazy-generations flag will not
|
||||
# create a new generation.
|
||||
|
||||
nix-env -i foo --lazy-generation
|
||||
|
||||
# Count generations.
|
||||
nix-env --list-generations
|
||||
test "$(nix-env --list-generations | wc -l)" -eq 8
|
||||
|
||||
|
||||
# Switch to a specified generation.
|
||||
nix-env --switch-generation 7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue