From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: Arun Isaac <arunisaac@systemreboot.net>,
Guix Devel <guix-devel@gnu.org>
Subject: Re: Move switch-symlinks to (guix build utils)
Date: Fri, 03 Jun 2022 21:30:04 +0200 [thread overview]
Message-ID: <87ilphilz7.fsf@gnu.org> (raw)
In-Reply-To: <2c194c3b2f192ba49caaf585703f95b6c6bcb7d9.camel@telenet.be> (Maxime Devos's message of "Fri, 03 Jun 2022 19:09:02 +0200")
Hi,
Maxime Devos <maximedevos@telenet.be> skribis:
> Maybe replace
>
> (symlink target pivot)
>
> by (symlink/remove-old target pivot)
>
> where
>
> (define (symlink/remove-old target link)
> "Make a symbolic link named LINK pointing to TARGET.
> If LINK already exists, it will be removed first.
> This is not an atomic operation."
> (catch 'system-error
> (lambda ()
> (symlink target link))
> (lambda stuff
> (if (= (system-error-errno stuff) EEXIST)
> (begin
> ;; remove old link and retry
> (delete-file link)
> (symlink/remove-old link target))
> (apply throw stuff)))))
Alright, SGTM (this procedure would be kept private).
So Arun, the floor is yours! :-)
Ludo’.
next prev parent reply other threads:[~2022-06-03 19:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 7:34 Move switch-symlinks to (guix build utils) Arun Isaac
2022-06-01 12:09 ` Maxime Devos
2022-06-02 15:06 ` Arun Isaac
2022-06-02 15:13 ` Maxime Devos
2022-06-03 16:38 ` Ludovic Courtès
2022-06-03 17:09 ` Maxime Devos
2022-06-03 19:30 ` Ludovic Courtès [this message]
2022-06-03 19:30 ` Ludovic Courtès
2022-06-03 23:55 ` bokr
2022-06-04 10:17 ` Maxime Devos
2022-06-06 11:27 ` Arun Isaac
2022-06-06 12:20 ` Maxime Devos
2022-06-08 20:12 ` Arun Isaac
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=87ilphilz7.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=arunisaac@systemreboot.net \
--cc=guix-devel@gnu.org \
--cc=maximedevos@telenet.be \
/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.