Hi! Alex Kost <alez...@gmail.com> skribis:
> What about the attached patch? Some comments and questions: > > - I added 'store' argument to the exported procedures, however it is > used only in one particular case: when we need to create an empty > profile (i.e. to call ‘link-to-empty-profile’). Is there a way to > avoid using 'store' argument there or is it fine to leave it like > this? For now it’s fine to leave it like this, with the ‘store’ argument. Eventually it should be changed to use the monadic style, though. > - I actually need only ‘delete-generations’ procedure for Emacs UI, but > I think other procedures are also worth to be exported or not? Yes, sure. > - Perhaps there is a better place for those functions than > (guix scripts package)? Yes, (guix profiles) would be a better place IMO. > - (Not related to this patch, but still …) Currently with “roll-back”, > we can only switch to the previous generation. What about adding a > possibility to switch to any generation? So that we could use > something like this: > > guix package --switch-generation=7 > > Also such functionality can be added to Emacs UI: for example pressing > "C" on a generation in *Guix Generation List* will make this > generation the current one. > > So ‘roll-back’ procedure may become a special case of the > ‘switch-generation’ one. WDYT? I think it’s a good idea! (I think it was suggested in earlier discussions, but never implemented.) > From c50d1674d3be699198afb649a2a9932ca44c89bc Mon Sep 17 00:00:00 2001 > From: Alex Kost <alez...@gmail.com> > Date: Sat, 4 Oct 2014 20:45:35 +0400 > Subject: [PATCH] guix package: Export generation procedures. > > * guix/scripts/package.scm: Export 'roll-back', 'delete-generation', > 'delete-generations'. > (link-to-empty-profile, roll-back): Add 'store' argument. > (delete-generations): New procedure. > (guix-package): Adjust accordingly. > [delete-generation]: Move to the top level. Add 'store' and 'profile' > arguments. > [display-and-delete]: Move to 'delete-generation'. OK to commit. To sum up, I would imagine two followups to this: 1. Move these procedures to (guix profiles). 2. Convert them to monadic style. WDYT? Thanks, Ludo’.