summary refs log tree commit diff
path: root/gnu/services.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-04-23 13:33:09 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-04-23 13:33:09 +0200
commit030f6f489fe9544f35ebaf95135acd1dd67ce63f (patch)
treef1d5d1f1b68de81daec6f05d032a0410a475d960 /gnu/services.scm
parent95c14929a7fbd3c55c5e8756953c2f257625e2b7 (diff)
parent938df0de739aa13c2fb483f440ec1db281a52aaa (diff)
downloadguix-030f6f489fe9544f35ebaf95135acd1dd67ce63f.tar.gz
Merge branch 'master' into core-updates
 Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/bootloaders.scm
	gnu/packages/linphone.scm
	gnu/packages/linux.scm
	gnu/packages/tls.scm
	gnu/system.scm
Diffstat (limited to 'gnu/services.scm')
-rw-r--r--gnu/services.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index 832d6984d8..126e0814eb 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -632,6 +632,23 @@ and FILE could be \"/usr/bin/env\"."
   (files->etc-directory (service-value service)))
 
 (define (files->etc-directory files)
+  (define (assert-no-duplicates files)
+    (let loop ((files files)
+               (seen (set)))
+      (match files
+        (() #t)
+        (((file _) rest ...)
+         (when (set-contains? seen file)
+           (raise (condition
+                   (&message
+                    (message (format #f (G_ "duplicate '~a' entry for /etc")
+                                     file))))))
+         (loop rest (set-insert file seen))))))
+
+  ;; Detect duplicates early instead of letting them through, eventually
+  ;; leading to a build failure of "etc.drv".
+  (assert-no-duplicates files)
+
   (file-union "etc" files))
 
 (define (etc-entry files)