[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/6] emacs: Find packages in system profiles.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH 3/6] emacs: Find packages in system profiles. |
Date: |
Wed, 13 Jan 2016 23:42:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Alex Kost <address@hidden> skribis:
> Ludovic Courtès (2016-01-12 23:28 +0300) wrote:
[...]
>> It seems you’re calling /run/current-system the system profile, which
>> leads to the ‘system?’ Boolean here, but the system profile really is
>> /run/current-system/profile.
>
> As we need to work with generations, I use "/var/guix/profiles/system"
> instead of a "/run/current-system" link. But you are right, I called it
> “system profile”.
>
> I think using "/var/guix/profiles/system/profile" wouldn't help to
> remove ‘system?’ boolean. For example:
>
> (guix-packages-profile "/var/guix/profiles/per-user/me/guix-profile" 3)
> => "/var/guix/profiles/per-user/me/guix-profile-3-link"
>
> (guix-packages-profile "/var/guix/profiles/system/profile" 3)
> => "/var/guix/profiles/system/profile-3-link"
>
> The first one is correct, but the second should be:
> => "/var/guix/profiles/system-3-link/profile"
>
> As you can see we need to distinguish system and usual profiles because
> packages are placed in different places for them
> ("system-NN-link/profile" and "usual-NN-link" without "profile" subdir),
> that's why I added ‘system?’ argument. I don't see how it can be
> avoided.
Oh you’re right, got it.
>> I had overlooked it, but wouldn’t it be easier if patch #2 did:
>>
>> +(defvar guix-system-profile
>> + (concat guix-config-state-directory "/profiles/system/profile")
>> + "System profile.")
>>
>> ?
> Not really.
>
> Both "/var/guix/profiles/system" (which I called “system profile”) and
> "/var/guix/profiles/system/profile" (which I called “packages profile”)
> are needed. The former — for finding generations, and the latter — for
> finding packages.
>
> I actually need "/var/guix/profiles/system" in the first place, so if
> ‘guix-system-profile’ is not an appropriate name for this variable, it
> should be renamed (what name do you suggest?).
Indeed, it’s confusing. I don’t have a better name to suggest, though.
> And about name confusion: now I see that “profile” should be used only
> for a directory (symlink) with packages. But I always thought that a
> directory that has generations can also be named a “profile” (apparently
> cannot), especially taking into account ‘profile-generations’ procedure
> from (guix profiles) module:
>
> (profile-generations "/var/guix/profiles/system")
>
> That's why ^^^ I called "/var/guix/profiles/system" a system profile.
Initially, I would have said that as long as FOO/manifest exists, FOO
can be called a profile. That’s the definition of a “profile” in the
sense of (guix profiles).
Like a profile, /var/guix/profiles/system has generations, but unlike
“real profiles”, it is not created by ‘profile-derivation’.
The solution in this patch looks good, after all!
Thanks for explaining,
Ludo’.
- Re: [PATCH 1/6] guix system: Export <boot-parameters> accessors., (continued)
[PATCH 2/6] emacs: profiles: Add 'guix-system-profile'., Alex Kost, 2016/01/10
[PATCH 4/6] emacs: Replace 'generation-diff' search with 'profile-diff'., Alex Kost, 2016/01/10
[PATCH 3/6] emacs: Find packages in system profiles., Alex Kost, 2016/01/10
[PATCH 5/6] emacs: Remove 'generation' search type., Alex Kost, 2016/01/10
[PATCH 6/6] emacs: Add interface for system generations., Alex Kost, 2016/01/10
Re: [PATCH 0/6] emacs: Add "M-x guix-system-generations"., Ludovic Courtès, 2016/01/12