[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: services: 'file-union' makes sure each source file exists.
From: |
Ludovic Courtès |
Subject: |
02/02: services: 'file-union' makes sure each source file exists. |
Date: |
Wed, 03 Feb 2016 21:29:14 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 37dd1e6a34698e5bccaf99b6681c503b1a4e5efc
Author: Ludovic Courtès <address@hidden>
Date: Wed Feb 3 22:26:33 2016 +0100
services: 'file-union' makes sure each source file exists.
Before that, specifying an invalid timezone in 'operating-system' would
lead to a dangling symlink in the 'etc' directory, which in turn would
lead to a kernel panic at boot time.
Reported by pizzaiolo on #guix.
* gnu/services.scm (file-union): Add 'stat' call for SOURCE.
---
gnu/services.scm | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/gnu/services.scm b/gnu/services.scm
index 056bb2a..1ad5737 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -291,7 +291,12 @@ file."
(chdir #$output)
#$@(map (match-lambda
((target source)
- #~(symlink #$source #$target)))
+ #~(begin
+ ;; Stat the source to abort early if it
+ ;; does not exist.
+ (stat #$source)
+
+ (symlink #$source #$target))))
files))))
(define (directory-union name things)