GNU bug report logs - #71217
[PATCH] gnu: home: dotfiles: Files not excluded when they

Previous Next

Package: guix-patches;

Reported by: Nicolas Odermatt-Lemay <nodermattlemay <at> gmail.com>

Date: Mon, 27 May 2024 02:14:01 UTC

Severity: normal

Full log


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

From: Nicolas Odermatt-Lemay <nodermattlemay <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: gnu: home: dotfiles: Files not excluded when they should
Date: Sun, 26 May 2024 22:13:26 -0400
[Message part 1 (text/plain, inline)]
Hello,

While attempting to setup home-dotfiles-service, I noticed that some files
were being symlinked even though they were in the variable
`%home-dotfiles-excluded', such as all the files of the .git directory.

This patch seems to fix the problem :

diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm
index 823bdb03fb..38f7ff83d0 100644
--- a/gnu/home/services/dotfiles.scm
+++ b/gnu/home/services/dotfiles.scm
@@ -45,7 +45,7 @@ (define-module (gnu home services dotfiles)
 (define %home-dotfiles-excluded
   '(".*~"
     ".*\\.swp"
-    "\\.git"
+    "\\.git/.*"
     "\\.gitignore"))

 (define %home-dotfiles-layouts
@@ -138,8 +138,7 @@ (define* (directory-contents directory #:key (packages
#f))
     (define (filter-files directory)
       (find-files directory
                   (lambda (file stat)
-                    (not (regexp-exec exclusion-rx
-                                      (basename file))))))
+                    (not (regexp-exec exclusion-rx file)))))
     (if (and stow? packages (maybe-value-set? packages))
         (append-map filter-files
                     (map (lambda (pkg)
[Message part 2 (text/html, inline)]

This bug report was last modified 199 days ago.

Previous Next


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