Alex Kost <alez...@gmail.com> skribis: > Ludovic Courtès (2014-10-10 02:08 +0400) wrote:
[...] >> This is bikeshedding, but I would make a hierarchy like this: >> >> &profile-error, with ‘profile’ field >> ^ >> .———————————————–+———————————————–. >> | | >> &profile-not-found-error &missing-generation-error, with >> ‘generation’ field > > Thank you for the idea btw, I like it. So the question is: should the > parent &profile-error be handled as well? If yes, what message to use? Let’s ignore it for now, it Shouldn’t Happen™. > 2. And another question: the current error for generation would look > like this: > > generation 18 does not exist > > Is it OK or should I use ‘generation-file-name’ there and make it: > > generation '/some/path/to/profile/generation-18-link' does not exist I prefer “generation 18 does not exist”, or maybe “generation 18 of ‘/some/profile’ does not exist”. WDYT? > The problem now is I can't add ‘switch-to-generation’ procedure to (guix > profiles) as it uses ‘_’ and ‘switch-symlinks’ from (guix ui) which is > not “#:use-module”-ed anymore. This patch is also attached. What to do > about it? I think moving ‘switch-to-generation’ to (guix ui) is not > good or is it? Yeah, a you suggested on IRC, let’s just leave it in (guix scripts package) until we have a better idea. :-) > From af9d9869f2430dd3e20885e685867c6843ba4279 Mon Sep 17 00:00:00 2001 > From: Alex Kost <alez...@gmail.com> > Date: Wed, 8 Oct 2014 17:29:01 +0400 > Subject: [PATCH 1/3] profiles: Add condition types for profiles and > generations. > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > Suggested by Ludovic Courtès. > > * guix/profiles.scm (&profile-error, &profile-not-found-error, > &missing-generation-error): New condition types. > * guix/ui.scm (call-with-error-handling): Handle new types. > * guix/scripts/package.scm (roll-back, guix-package): Raise > '&profile-not-found-error' where needed. Perfect! > From da49a2b7af5295c3c72b7e4590219cbac827877b Mon Sep 17 00:00:00 2001 > From: Alex Kost <alez...@gmail.com> > Date: Wed, 8 Oct 2014 00:39:42 +0400 > Subject: [PATCH 2/3] profiles: Add procedures for switching generations. > > * guix/scripts/package.scm (switch-to-previous-generation): Move to... > * guix/profiles.scm: ... here. Use 'switch-to-generation'. > (relative-generation): New procedure. > (previous-generation-number): Use it. > (switch-to-generation): New procedure. Perfect as well, OK to commit. Thanks, Ludo’.