[PATCH] gnu: home: dotfiles: Files not excluded when they

  • Open
  • quality assurance status badge
Details
3 participants
  • paul
  • Ludovic Courtès
  • Nicolas Odermatt-Lemay
Owner
unassigned
Submitted by
Nicolas Odermatt-Lemay
Severity
normal
N
N
Nicolas Odermatt-Lemay wrote on 27 May 04:13 +0200
gnu: home: dotfiles: Files not excluded when they should
(address . bug-guix@gnu.org)
CAC-BrWpcu=+Lb_=0VUSWP4w92ohTH30zY1YA6K=-GiegfpVB7A@mail.gmail.com
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 :

Toggle diff (24 lines)
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)
Attachment: file
N
N
Nicolas Odermatt-Lemay wrote on 28 May 02:21 +0200
control message for bug #71217
(address . control@debbugs.gnu.org)
CAC-BrWrRRZh4LUJW_Bpuf=MHOe=gpUbF7D6WuW+CBh=4O0q5kA@mail.gmail.com
retitle 71217 [PATCH] gnu: home: dotfiles: Files not excluded when they
should
quit
Attachment: file
L
L
Ludovic Courtès wrote on 30 Jun 18:00 +0200
(address . control@debbugs.gnu.org)
87bk3ixvwx.fsf@gnu.org
reassign 71217 guix-patches
quit
L
L
Ludovic Courtès wrote on 20 Nov 23:33 +0100
Re: bug#71217: gnu: home: dotfiles: Files not excluded when they should
(name . Nicolas Odermatt-Lemay)(address . nodermattlemay@gmail.com)
87zflttu0f.fsf@gnu.org
Hi,

(Cc: Giacomo, who authored this service.)

Nicolas Odermatt-Lemay <nodermattlemay@gmail.com> skribis:

Toggle quote (4 lines)
> 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.

Oh.

Toggle quote (24 lines)
> 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)))))

That would change the semantics of ‘exclusion-rx’ though.

Maybe instead we should change from ‘file-files’ to ‘file-system-fold’
and not enter directories that match one of the exclusion patterns?

Ludo’.
P
P
paul wrote 7 hours ago
(address . 71217@debbugs.gnu.org)
f743e3c3-9a3d-4ed8-aa0e-a3adb74a1ab3@autistici.org
Hi Ludo’ and Nicolas,

I think this service has some rough edges besides this bug, I made a
proposal to smooth them out with a new configuration record which
deprecates home-dotfiles-configuration, better separates the state
needed only for stow layouts and fixes this bug at [0].

Please let me know your thoughts about it, thank you!

cheers

giacomo

?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 71217
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