summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-01-27 17:58:46 +0100
committerLudovic Courtès <ludo@gnu.org>2013-01-27 17:58:46 +0100
commit82fe08ed207a17c51370dc90e965c15ee9db9235 (patch)
treef9a06dfc729e5ce0af5013fa1370b875b7e3014f /tests
parentd9307267b3b4a87391e33daacef162745f057c3d (diff)
downloadguix-82fe08ed207a17c51370dc90e965c15ee9db9235.tar.gz
guix-package: Always use the next number for new generations.
Suggested by Andreas Enge <andreas@enge.fr> at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00325.html>.

* guix-package.in (latest-profile-number): Remove.
  (switch-symlinks): New procedure.
  (roll-back)[switch-link]: Use it.
  (guix-package)[process-actions]: Always choose NUMBER + 1 for the new
  profile.  Use `switch-symlinks' instead of `symlink'.  Remove code to
  delete PROFILE when it exists since `switch-symlinks' has the same
  effect.
* tests/guix-package.sh: Adjust existing `--roll-back' tests.
* doc/guix.texi (Invoking guix-package): Document this `--roll-back'
  behavior.
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-package.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 87b95236ff..bd63c21969 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -90,22 +90,26 @@ then
 	test "`readlink_base "$profile"`" = "$profile-0-link"
     done
 
-    # Reinstall after roll-back to generation 1.
+    # Reinstall after roll-back to the empty profile.
     guix-package --bootstrap -p "$profile" -i "$boot_make"
-    test "`readlink_base "$profile"`" = "$profile-4-link"
-    test -x "$profile/bin/guile" && test -x "$profile/bin/make"
+    test "`readlink_base "$profile"`" = "$profile-1-link"
+    test -x "$profile/bin/guile" && ! test -x "$profile/bin/make"
 
-    # Roll-back to generation 3[*], and install---all at once.
-    # [*] FIXME: Eventually, this should roll-back to generation 1.
+    # Roll-back to generation 0, and install---all at once.
     guix-package --bootstrap -p "$profile" --roll-back -i "$boot_guile"
-    test "`readlink_base "$profile"`" = "$profile-5-link"
+    test "`readlink_base "$profile"`" = "$profile-1-link"
+    test -x "$profile/bin/guile" && ! test -x "$profile/bin/make"
+
+    # Install Make.
+    guix-package --bootstrap -p "$profile" -i "$boot_make"
+    test "`readlink_base "$profile"`" = "$profile-2-link"
     test -x "$profile/bin/guile" && test -x "$profile/bin/make"
 
     # Make a "hole" in the list of generations, and make sure we can
     # roll back "over" it.
-    rm "$profile-4-link"
+    rm "$profile-1-link"
     guix-package --bootstrap -p "$profile" --roll-back
-    test "`readlink_base "$profile"`" = "$profile-3-link"
+    test "`readlink_base "$profile"`" = "$profile-0-link"
 fi
 
 # Make sure the `:' syntax works.