From 06a75a7e0c1813d90c205e654da43a32812ce5f4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 8 Feb 2004 14:07:43 +0000 Subject: * A command `--switch-generation' to switch to a specific generation of the current profile, e.g., $ nix-env --list-generations ... 39 2004-02-02 17:53:53 40 2004-02-02 17:55:18 41 2004-02-02 17:55:41 42 2004-02-02 17:55:50 (current) $ nix-env --switch-generation 39 $ ls -l /nix/var/nix/profiles/default ... default -> default-39-link * Also a command `--rollback' which is just a convenience operation to rollback to the oldest generation younger than the current one. Note that generations properly form a tree. E.g., if after switching to generation 39, we perform an installation action, a generation 43 is created which is a descendant of 39, not 42. So a rollback from 43 ought to go back to 39. This is not currently implemented; generations form a linear sequence. --- src/nix-env/profiles.hh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nix-env/profiles.hh') diff --git a/src/nix-env/profiles.hh b/src/nix-env/profiles.hh index 2422c9f7425a..2ce468dfa837 100644 --- a/src/nix-env/profiles.hh +++ b/src/nix-env/profiles.hh @@ -11,6 +11,14 @@ struct Generation int number; Path path; time_t creationTime; + Generation() + { + number = -1; + } + operator bool() const + { + return number != -1; + } }; typedef list Generations; -- cgit 1.4.1