unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <m.othacehe@gmail.com>
To: 40955@debbugs.gnu.org
Cc: Mathieu Othacehe <m.othacehe@gmail.com>
Subject: [bug#40955] [PATCH 2/5] build: install: Ignore chown exceptions.
Date: Wed, 29 Apr 2020 10:47:53 +0200	[thread overview]
Message-ID: <20200429084756.25072-2-m.othacehe@gmail.com> (raw)
In-Reply-To: <20200429084756.25072-1-m.othacehe@gmail.com>

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





  reply	other threads:[~2020-04-29  8:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29  8:38 [bug#40955] [PATCH 0/5] Add new image API Mathieu Othacehe
2020-04-29  8:47 ` [bug#40955] [PATCH 1/5] build: store-copy: Export file-size procedure Mathieu Othacehe
2020-04-29  8:47   ` Mathieu Othacehe [this message]
2020-05-02 11:09     ` [bug#40955] [PATCH 2/5] build: install: Ignore chown exceptions Ludovic Courtès
2020-05-05 13:42       ` Mathieu Othacehe
2020-04-29  8:47   ` [bug#40955] [PATCH 3/5] build: bootloader: Add install-efi procedure Mathieu Othacehe
2020-05-02 12:16     ` Ludovic Courtès
2020-05-05 13:43       ` Mathieu Othacehe
2020-04-29  8:47   ` [bug#40955] [PATCH 4/5] image: Add a new API Mathieu Othacehe
2020-05-02 12:50     ` Ludovic Courtès
2020-05-05 13:52       ` Mathieu Othacehe
2020-05-02 13:02     ` Tobias Geerinckx-Rice via Guix-patches via
2020-05-05 14:12       ` Mathieu Othacehe
2020-04-29  8:47   ` [bug#40955] [PATCH 5/5] vm: Remove obsolete procedures Mathieu Othacehe
2020-05-02 12:52     ` Ludovic Courtès
2020-05-05 14:02       ` Mathieu Othacehe
2020-05-05 14:16       ` bug#40955: " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200429084756.25072-2-m.othacehe@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=40955@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).