From 82fe08ed207a17c51370dc90e965c15ee9db9235 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 27 Jan 2013 17:58:46 +0100 Subject: guix-package: Always use the next number for new generations. Suggested by Andreas Enge at . * 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. --- tests/guix-package.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests/guix-package.sh') 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. -- cgit v1.2.3