guix-devel
[Top][All Lists]
Advanced

[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: Tue, 12 Jan 2016 21:28:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Alex Kost <address@hidden> skribis:

> For a usual profile, packages are placed in a profile directory itself,
> but for a system profile, packages are placed in 'profile'
> sub-directory.  So we need to do some special cases for system profiles
> to find packages there as well.
>
> * emacs/guix-base.el (guix-packages-profile): New procedure.
>   (guix-manifest-file): Use it.  Add optional 'system?' argument.
> * emacs/guix-ui-generation.el (guix-system-generation?)
>   (guix-generation-current-packages-profile):  New procedures.
>   (guix-generation-packages, guix-generation-insert-packages)
>   (guix-generation-packages-buffer): Add optional 'system?' argument.
>   (guix-profile-generation-manifest-file)
>   (guix-profile-generation-packages-buffer): Adjust accordingly.
> * emacs/guix-main.scm (generation-package-specifications+paths): Rename to...
>   (profile->specifications+paths): ... this.  Use a single 'profile' argument.

[...]

> +(defun guix-packages-profile (profile &optional generation system?)
> +  "Return a directory where packages are installed for the
> +PROFILE's GENERATION.
> +
> +If SYSTEM? is non-nil, then PROFILE is considered to be a system
> +profile.  Unlike usual profiles, for a system profile, packages
> +are placed in 'profile' subdirectory."
> +  (let ((profile (if generation
> +                     (guix-generation-file profile generation)
> +                   profile)))
> +    (if system?
> +        (expand-file-name "profile" profile)
> +      profile)))

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.

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.")
?

Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]