Subject: [PATCH 2/5] build: install: Ignore chown exceptions.

From: Mathieu Othacehe <[email-masked]>
Date: Wed, 29 Apr 2020 10:47:53 +0200

Changing ownership may require root permissions. As image can now be generated
without root permissions (no VM involved), ignore those exceptions.

* gnu/build/install.scm (evaluate-populate-directive): Ignore chown
exceptions.
---
 gnu/build/install.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index c0d4d44091..0b0d01cf86 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -63,7 +63,9 @@ directory TARGET."
           (('directory name uid gid)
            (let ((dir (string-append target name)))
              (mkdir-p dir)
-             (chown dir uid gid)))
+             ;; This will fail if this is not run from a VM, ignore those
+             ;; errors.
+             (false-if-exception (chown dir uid gid))))
           (('directory name uid gid mode)
            (loop `(directory ,name ,uid ,gid))
            (chmod (string-append target name) mode))
-- 
2.26.0