[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating user profiles

From: Ludovic Courtès
Subject: Re: Creating user profiles
Date: Sun, 13 Jan 2013 23:45:34 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Andreas Enge <address@hidden> skribis:

> I simply applied the patch, and it seems to be part of the solution.
> Upon a first run of "guix-package --list-available", I obtained the error 
> message inviting me to create the directory, which I did. The next call 
> succeeded. But now $HOME/.guix-profile points to the non-existing 
> /usr/local/guix-git/var/nix/profiles/per-user/privat/guix-profile, and I 
> get the error:


>    ?: 0 [symlink "/usr/local/guix-git/var/nix/profiles/per-
> user/privat/guix-profile" ...]
> ERROR: In procedure symlink:
> ERROR: In procedure symlink: File exists

Aah, I see.  That’s because it did (file-exists? ".guix-profile"), but
this uses stat(2).  So here, because .guix-profile was a dangling
symlink, it returned #f, even though the symlink actually existed.  I
fixed it using ‘lstat’ instead.


> I would suggest the following: Before making the $HOME/.guix-profile 
> symlink, check for the guix-profile symlink in the per-user profile 
> directory. If it does not exist, create it as a link to the empty user 
> environment. So there will always be guix-profile-1-link linking to the 
> empty directory, which might also be useful for roll back (never delete 
> this first empty environment).

Having this empty user environment on disk should not be needed because
internally, ‘profile-manifests’ explicitly checks whether the profile
exists, and returns an empty manifest if it doesn’t.

So I’m committing the patch, minus the above bug.

Thanks for the very quick feedback!


reply via email to

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