diff options
| author | Hilton Chain <hako@ultrarare.space> | 2026-02-05 22:49:10 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2026-02-06 19:14:46 +0800 |
| commit | 4d1966c37526a94e5d5e73fa7f772d9d5edd8bfb (patch) | |
| tree | ee01c28b9eb691992ebe069fd309c0936fa7ed55 /gnu | |
| parent | 689ee928a61fe95f3d9fca1a40bd81173b1c2e25 (diff) | |
activation: copy-account-skeletons: Make all copied skeletons writable.
Previously, copying skeleton ‘.config/nano/nanorc’ to user home won't make
‘~/.config/nano/nanorc’ writable.
* gnu/build/activation.scm (copy-account-skeletons)
[set-owner]: Make all copied skeleton writable.
Rename procedure to ‘set-permission’.
Change-Id: I24a2bda42bc5af803857dc090e487b6a040b58be
Signed-off-by: Hilton Chain <hako@ultrarare.space>
Merges: #6149
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/build/activation.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index e2d1734367d..53844c0990e 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -141,12 +141,13 @@ and bits are set according to the default behaviour of 'mkdir'." #:key (directory %skeleton-directory) uid gid) - "Copy the account skeletons from DIRECTORY to HOME. When UID is an integer, -make it the owner of all the files created except the home directory; likewise -for GID." - (define (set-owner file) + "Copy the account skeletons from DIRECTORY to HOME and make them writable. +When UID is an integer, make it the owner of all the files created except the +home directory; likewise for GID." + (define (set-permission file) (when (or uid gid) - (chown file (or uid -1) (or gid -1)))) + (chown file (or uid -1) (or gid -1))) + (make-file-writable file)) (let ((files (scandir directory (negate dot-or-dot-dot?) string<?))) @@ -156,10 +157,9 @@ for GID." (copy-recursively (string-append directory "/" file) target #:log (%make-void-port "w")) - (for-each set-owner + (for-each set-permission (find-files target (const #t) - #:directories? #t)) - (make-file-writable target))) + #:directories? #t)))) files))) (define* (make-skeletons-writable home |
