From 3d8318870289d7b6b08677fcd2da6ceb0b082f8c Mon Sep 17 00:00:00 2001 From: Christian Theune Date: Mon, 18 May 2015 08:38:49 +0200 Subject: Enable lazy/sparse allocation of generation symlinks: avoid creating new generations if a generation already exists. Alternatively or additionally I propose a mode where only the *last* generation will be sparse. --- tests/user-envs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/user-envs.sh b/tests/user-envs.sh index c9eed5a6633d..ad15ddc3e441 100644 --- a/tests/user-envs.sh +++ b/tests/user-envs.sh @@ -99,6 +99,15 @@ 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. +nix-env -i foo + +# Count generations. +nix-env --list-generations +test "$(nix-env --list-generations | wc -l)" -eq 7 + # Switch to a specified generation. nix-env --switch-generation 7 [ "$(nix-store -q --resolve $profiles/test)" = "$oldGen" ] -- cgit 1.4.1