diff options
author | Leo Famulari <leo@famulari.name> | 2018-09-13 13:32:39 -0400 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2018-09-13 13:32:39 -0400 |
commit | d7639407110a584c18bb362c942eeb0933188c66 (patch) | |
tree | 8068d0737e2a65f8f9f7080b7f9fb36a74e58e2c /guix/build | |
parent | 36e8185667c41740786d9b2eb3672a0f8b902ed8 (diff) | |
parent | 7d1cc612938565d935c53bd7a429f41d1f048dae (diff) | |
download | gnu-guix-d7639407110a584c18bb362c942eeb0933188c66.tar gnu-guix-d7639407110a584c18bb362c942eeb0933188c66.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/profiles.scm | 15 | ||||
-rw-r--r-- | guix/build/syscalls.scm | 4 |
2 files changed, 14 insertions, 5 deletions
diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm index df785c85a7..0c23cd300e 100644 --- a/guix/build/profiles.scm +++ b/guix/build/profiles.scm @@ -94,12 +94,20 @@ definitions for all the SEARCH-PATHS." (for-each (write-environment-variable-definition port) (map (abstract-profile output) variables)))))) -(define (ensure-writable-directory directory) +(define* (ensure-writable-directory directory + #:key (symlink symlink)) "Ensure DIRECTORY exists and is writable. If DIRECTORY is currently a symlink (to a read-only directory in the store), then delete the symlink and instead make DIRECTORY a \"real\" directory containing symlinks." + (define (absolute? file) + (string-prefix? "/" file)) + (define (unsymlink link) - (let* ((target (readlink link)) + (let* ((target (match (readlink link) + ((? absolute? target) + target) + ((? string? relative) + (string-append (dirname link) "/" relative)))) ;; TARGET might itself be a symlink, so append "/" to make sure ;; 'scandir' enters it. (files (scandir (string-append target "/") @@ -149,7 +157,8 @@ SEARCH-PATHS." ;; Make sure we can write to 'OUTPUT/etc'. 'union-build' above could have ;; made 'etc' a symlink to a read-only sub-directory in the store so we need ;; to work around that. - (ensure-writable-directory (string-append output "/etc")) + (ensure-writable-directory (string-append output "/etc") + #:symlink symlink) ;; Write 'OUTPUT/etc/profile'. (build-etc/profile output search-paths)) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 74cb675fcf..56a689f667 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -385,8 +385,8 @@ the returned procedure is called." #:return-errno? #t))) (lambda args (lambda _ - (error (format #f "~a: syscall->procedure failed: ~s" - name args)))))) + (throw 'system-error name "~A" (list (strerror ENOSYS)) + (list ENOSYS)))))) (define-syntax define-as-needed (syntax-rules () |