diff mbox series

[bug#68857] gnu: home: dotfiles: Avoid creating extra directory in $HOME.

Message ID 20240131221748.1190-1-goodoldpaul@autistici.org
State New
Headers show
Series [bug#68857] gnu: home: dotfiles: Avoid creating extra directory in $HOME. | expand

Commit Message

Giacomo Leidi Jan. 31, 2024, 10:17 p.m. UTC
This patch applies the fix from https://issues.guix.gnu.org/60521#43 ,
it is supposed to fix https://issues.guix.gnu.org/68848 .

* gnu/home/services/dotfiles.scm (import-dotfiles)[strip]: Drop extra
directory.

Change-Id: I98b747396e1fc8a8925204cde2bb705019ce2c1d
---
 gnu/home/services/dotfiles.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


base-commit: bf7991a8c767abd32cfb2c92e3d57665a7cabf00
diff mbox series

Patch

diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm
index 6a740c42ce..fc842f1fb3 100644
--- a/gnu/home/services/dotfiles.scm
+++ b/gnu/home/services/dotfiles.scm
@@ -58,7 +58,11 @@  (define (import-dotfiles directory files)
 generated by recursively visiting DIRECTORY and mapping its contents to the
 user's home directory, excluding files that match any of the patterns in EXCLUDED."
   (define (strip file)
-    (string-drop file (+ 1 (string-length directory))))
+    (string-join
+     (cdr
+      (string-split (string-drop file (+ 1 (string-length directory)))
+                    #\/))
+     "/"))
 
   (define (format file)
     ;; Remove from FILE characters that cannot be used in the store.