GNU bug report logs - #68857
gnu: home: dotfiles: Avoid creating extra directory in $HOME.

Previous Next

Package: guix-patches;

Reported by: paul <goodoldpaul <at> autistici.org>

Date: Wed, 31 Jan 2024 22:17:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 68857 <at> debbugs.gnu.org (full text, mbox):

From: Giacomo Leidi <goodoldpaul <at> autistici.org>
To: 68857 <at> debbugs.gnu.org
Cc: Giacomo Leidi <goodoldpaul <at> autistici.org>
Subject: [PATCH] gnu: home: dotfiles: Avoid creating extra directory in $HOME.
Date: Wed, 31 Jan 2024 23:17:48 +0100
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(-)

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.

base-commit: bf7991a8c767abd32cfb2c92e3d57665a7cabf00
-- 
2.41.0





This bug report was last modified 1 year and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.