From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Preparing for an alpha release Date: Sun, 16 Dec 2012 22:54:24 +0100 Message-ID: <87d2y9irxr.fsf@gnu.org> References: <878v8yj5q3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkMAH-0004o2-2u for bug-guix@gnu.org; Sun, 16 Dec 2012 16:54:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkMAF-00032l-Ep for bug-guix@gnu.org; Sun, 16 Dec 2012 16:54:29 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:64647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkMAF-00032e-7w for bug-guix@gnu.org; Sun, 16 Dec 2012 16:54:27 -0500 In-Reply-To: (Nikita Karetnikov's message of "Sun, 16 Dec 2012 21:43:20 +0300") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Hello, Nikita Karetnikov skribis: >> things related to command-line tools, such as options documented and >> not implemented in =E2=80=98guix-package=E2=80=99; > > I'd like to implement '--roll-back' and '--search'. Cool! > Questions: > > scheme@(guile-user)> ,use (guix-package) > scheme@(guile-user)> %current-profile > $1 =3D "/nix/var/nix/profiles/per-user/root/guix-profile" > scheme@(guile-user)> %profile-directory > $2 =3D "/nix/var/nix/profiles/per-user/root" > scheme@(guile-user)> %user-environment-directory > $3 =3D "/root/.guix-profile" > > 'ls' doesn't list the above. Why? $1 gets created only once you=E2=80=99ve run =E2=80=98guix-package --instal= l=E2=80=99. And $3 has to be created manually, currently. Probably =E2=80=98guix-packa= ge=E2=80=99 should create it automatically. It=E2=80=99s just a fixed symlink to $1. > How should '--roll-back' work? Just change /nix/var/nix/profiles/per-user/root/guix-profile to point to /nix/var/nix/profiles/per-user/root/guix-PREV-profile, where PREV is the previous generation number (see =E2=80=98latest-profile-number=E2=80=99 in = guix-package.) > Does Guix support multiple profiles? Yes: see the --profile option of guix-package. Same as for nix-env. > Nix uses the following scheme. [1] > > # ls /nix/var/nix/profiles/ > default default-2-link default-5-link default-8-link > default-10-link default-3-link default-6-link default-9-link > default-1-link default-4-link default-7-link per-user > > What function should be used to access the pointee of 'guix-profile'? You could use (readlink %current-profile), and then the %PROFILE-RX regexp of =E2=80=98latest-profile-number=E2=80=99 to extract the profile nu= mber. > I assume that it should work like this: > > 1. Get the pointee of 'guix-profile'. > > 2. Parse the name of the pointee. > > 3. Decrement the number and save that as '%current-profile'. Yes, that=E2=80=99s the idea. And then (delete-file %current-profile) and (symlink new-profile %current-profile). > Should 'guix-package' also support '--switch-generation', Likewise: delete %current-profile and make it point elsewhere. > '--list-generations', List the files in %PROFILE-DIRECTORY matching %PROFILE-RX. > and '--switch-profile'? [1] Not sure about this one, but it=E2=80=99s basically changing a symlink=E2= =80=99s target again. > How to implement '--search'? User would provide a regexp, and you would use =E2=80=98fold-packages=E2=80= =99 to traverse all the packages and pattern-match each synopsis and description, and return the matching packages. How does that sound? Thanks! Ludo=E2=80=99.