all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] build: Do not clobber existing files when bind mounting.
@ 2015-10-16 18:36 Thompson, David
  2015-10-17 13:36 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Thompson, David @ 2015-10-16 18:36 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 140 bytes --]

This really bit me while trying to wrap up the tests for 'guix
environment --container'.  Thanks to Ludovic for tracking this down!

- Dave

[-- Attachment #2: 0001-build-Do-not-clobber-existing-files-when-bind-mounti.patch --]
[-- Type: text/x-diff, Size: 1103 bytes --]

From 482a31152260f48d1e96ffe74a2b1a9898d5f09c Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Fri, 16 Oct 2015 14:00:00 -0400
Subject: [PATCH] build: Do not clobber existing files when bind mounting.

* gnu/build/file-systems.scm (mount-file-system): Do not touch
  'mount-point' if it already exists.
---
 gnu/build/file-systems.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 377bec2..df6d3da 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -347,7 +347,8 @@ run a file system check."
        ;; Create the mount point.  Most of the time this is a directory, but
        ;; in the case of a bind mount, a regular file may be needed.
        (if (and (= MS_BIND (logand flags MS_BIND))
-                (regular-file? source))
+                (regular-file? source)
+                (not (file-exists? mount-point)))
            (begin
              (mkdir-p (dirname mount-point))
              (call-with-output-file mount-point (const #t)))
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] build: Do not clobber existing files when bind mounting.
  2015-10-16 18:36 [PATCH] build: Do not clobber existing files when bind mounting Thompson, David
@ 2015-10-17 13:36 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-10-17 13:36 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

"Thompson, David" <dthompson2@worcester.edu> skribis:

> From 482a31152260f48d1e96ffe74a2b1a9898d5f09c Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Fri, 16 Oct 2015 14:00:00 -0400
> Subject: [PATCH] build: Do not clobber existing files when bind mounting.
>
> * gnu/build/file-systems.scm (mount-file-system): Do not touch
>   'mount-point' if it already exists.

Oops, I ended up pushing a similar thing this morning as 78981bb, due to
my mail-checking asynchronicity!  Let me know if it’s OK.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-17 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 18:36 [PATCH] build: Do not clobber existing files when bind mounting Thompson, David
2015-10-17 13:36 ` Ludovic Courtès

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.