all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: guix-devel@gnu.org
Cc: Marius Bakke <mbakke@fastmail.com>
Subject: [PATCH core-updates 6/6] utils: Add helper method to make files writable.
Date: Wed, 25 Jan 2017 18:19:38 +0100	[thread overview]
Message-ID: <20170125171938.27271-7-mbakke@fastmail.com> (raw)
In-Reply-To: <20170125171938.27271-1-mbakke@fastmail.com>

* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
---
 gnu/build/activation.scm        | 5 -----
 guix/build/gnu-build-system.scm | 6 ++++--
 guix/build/utils.scm            | 6 ++++++
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index 1b31dc153..756a6872b 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -78,11 +78,6 @@
 (define (dot-or-dot-dot? file)
   (member file '("." "..")))
 
-(define (make-file-writable file)
-  "Make FILE writable for its owner.."
-  (let ((stat (lstat file)))                      ;XXX: symlinks
-    (chmod file (logior #o600 (stat:perms stat)))))
-
 (define* (copy-account-skeletons home
                                  #:optional (directory %skeleton-directory))
   "Copy the account skeletons from DIRECTORY to HOME."
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 59394c2ca..e83ec22ae 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -393,8 +393,10 @@ makefiles."
                      (or (elf-file? file) (ar-file? file))
                      (or (not debug-output)
                          (make-debug-file file))
-                     ;; Ensure libraries are writable.
-                     (chmod file #o755)
+
+                     ;; Ensure the file is writable.
+                     (make-file-writable file)
+
                      (zero? (apply system* strip-command
                                    (append strip-flags (list file))))
                      (or (not debug-output)
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index cf0932639..021df1bfb 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -48,6 +48,7 @@
             with-directory-excursion
             mkdir-p
             install-file
+            make-file-writable
             copy-recursively
             delete-file-recursively
             file-name-predicate
@@ -237,6 +238,11 @@ name."
   (mkdir-p directory)
   (copy-file file (string-append directory "/" (basename file))))
 
+(define (make-file-writable file)
+  "Make FILE writable for its owner.."
+  (let ((stat (lstat file)))                      ;XXX: symlinks
+    (chmod file (logior #o600 (stat:perms stat)))))
+
 (define* (copy-recursively source destination
                            #:key
                            (log (current-output-port))
-- 
2.11.0

  parent reply	other threads:[~2017-01-25 17:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 17:19 [PATCH core-updates 0/6] Wait up! Marius Bakke
2017-01-25 17:19 ` [PATCH core-updates 1/6] gnu: Add libxfont2 Marius Bakke
2017-01-25 17:19 ` [PATCH core-updates 2/6] gnu: xorg-server: Use 'modify-phases' syntax Marius Bakke
2017-01-25 17:19 ` [PATCH core-updates 3/6] gnu: xorg-server: Update to 1.19.1 Marius Bakke
2017-01-25 17:19 ` [PATCH core-updates 4/6] gnu: xf86-video-qxl: Change to libxfont2 ABI Marius Bakke
2017-01-25 17:19 ` [PATCH core-updates 5/6] gnu: xf86-video-intel: Update to 2.99.917-2-028c946 Marius Bakke
2017-01-25 17:19 ` Marius Bakke [this message]
2017-01-26  9:50   ` [PATCH core-updates 6/6] utils: Add helper method to make files writable Ludovic Courtès
2017-01-26 21:21     ` Marius Bakke
2017-01-25 19:05 ` [PATCH core-updates 0/6] Wait up! Leo Famulari
2017-01-26 16:27   ` Marius Bakke

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

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

  git send-email \
    --in-reply-to=20170125171938.27271-7-mbakke@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=guix-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.