all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andreas Enge <andreas@enge.fr>
Cc: bug-guix@gnu.org
Subject: Re: Creating user profiles
Date: Sun, 13 Jan 2013 23:45:34 +0100	[thread overview]
Message-ID: <87wqvgog6p.fsf@gnu.org> (raw)
In-Reply-To: <201301132331.44244.andreas@enge.fr> (Andreas Enge's message of "Sun, 13 Jan 2013 23:31:44 +0100")

Andreas Enge <andreas@enge.fr> 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!

Ludo’.

      reply	other threads:[~2013-01-13 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13 13:23 Creating user profiles Andreas Enge
2013-01-13 22:05 ` Ludovic Courtès
2013-01-13 22:31   ` Andreas Enge
2013-01-13 22:45     ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqvgog6p.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=andreas@enge.fr \
    --cc=bug-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.