[PATCH] system: skeleton-directory: Allow copying into subdirectories.

  • Open
  • quality assurance status badge
Details
One participant
  • Sughosha
Owner
unassigned
Submitted by
Sughosha
Severity
normal

Debbugs page

Sughosha wrote on 11 Feb 15:17 +0100
(address . guix-patches@gnu.org)(name . Sughosha)(address . sughosha@disroot.org)
d7d99d3e79ee479f34f151c742cb060e200e5984.1739283450.git.sughosha@disroot.org
This fixes the error while copying the source to the target that is supposed to
go into subdirectories that are not present yet.

* gnu/shadow.scm (skeleton-directory): Create the parent directories of the
target if not present before copying the source.

Change-Id: I91e669968107d3d2b299b61b24ac1cc1895ebf76
---
gnu/system/shadow.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (18 lines)
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 48eca2564f..c68d8306fa 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -320,6 +320,9 @@ (define (skeleton-directory skeletons)
;; would just copy the symlinks as is.
(for-each (match-lambda
((target source)
+ (when (not (directory-exists?
+ (dirname target)))
+ (mkdir-p (dirname target)))
(copy-recursively source target)))
'#$skeletons)
;; Make nanorc respect XDG_CONFIG_HOME.

base-commit: 555937448cc510517011035fbf39c3687336759d
--
2.47.1
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76204@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76204
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch