summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-14 19:05:21 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-14 19:07:04 +0200
commitf3b692acdd6da6c6a660f3d1b8de79e7f6ca25c7 (patch)
tree85c3652ee60dbf3b8a251533ea5ecf54cd930460
parent7f17ff78419b6088cbc8cec6e5f567a317fba809 (diff)
downloadguix-f3b692acdd6da6c6a660f3d1b8de79e7f6ca25c7.tar.gz
activation: Silence warning from 'useradd'.
* guix/build/activation.scm (add-user): Don't pass '--create-home' when
  HOME already exists.
-rw-r--r--guix/build/activation.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/build/activation.scm b/guix/build/activation.scm
index 895f2bca5b..267c592b52 100644
--- a/guix/build/activation.scm
+++ b/guix/build/activation.scm
@@ -73,7 +73,11 @@ properties.  Return #t on success."
                           `("-G" ,(string-join supplementary-groups ","))
                           '())
                     ,@(if comment `("-c" ,comment) '())
-                    ,@(if home `("-d" ,home "--create-home") '())
+                    ,@(if home
+                          (if (file-exists? home)
+                              `("-d" ,home)     ; avoid warning from 'useradd'
+                              `("-d" ,home "--create-home"))
+                          '())
                     ,@(if shell `("-s" ,shell) '())
                     ,@(if password `("-p" ,password) '())
                     ,name)))