utils: Add helper method to make files writable.

* 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.
This commit is contained in:
Marius Bakke 2017-01-25 16:28:03 +01:00
parent 14551e073f
commit 5a64a79131
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
3 changed files with 10 additions and 7 deletions

View File

@ -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."

View File

@ -392,8 +392,10 @@ makefiles."
(and (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.
(begin (make-file-writable file) #t)
(zero? (apply system* strip-command
(append strip-flags (list file))))
(or (not debug-output)

View File

@ -50,6 +50,7 @@
with-directory-excursion
mkdir-p
install-file
make-file-writable
copy-recursively
delete-file-recursively
file-name-predicate
@ -262,6 +263,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))