GNU bug report logs - #60521
[PATCH] home: Add home-stow-migration-service.

Previous Next

Package: guix-patches;

Reported by: goodoldpaul <at> autistici.org

Date: Tue, 3 Jan 2023 16:53:02 UTC

Severity: normal

Tags: moreinfo, patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Giacomo Leidi <goodoldpaul <at> autistici.org>, andrew <at> trop.in,
 60521 <at> debbugs.gnu.org
Subject: Re: [bug#60521] [PATCH] home: Add home-stow-migration-service.
Date: Mon, 29 Jan 2024 14:40:29 +0100
Ludovic Courtès <ludo <at> gnu.org> writes:

> Sergey Trofimov <sarg <at> sarg.org.ru> skribis:
>
>> (define* (as-local-files dir #:optional (trim-prefix dir))
>>   (let ((absolute-dir (string-append (getcwd) "/" dir))
>>         (to-trim (string-append (getcwd) "/" trim-prefix "/")))
>>     (map (lambda (fn)
>>            (list
>>             (del-prefix to-trim fn)
>>             (local-file (canonicalize-path fn) (del-prefix "."
>>             (basename fn)) #:recursive? #t)))
>>          (find-files absolute-dir))))
>
> As you saw, I proposed a different solution: capturing
> (current-source-directory) in ‘home-dotfiles-configuration’ and 
> using
> that to compute absolute file names (without ever calling
> ‘canonicalize-path’).
>
> Using ‘getcwd’ would be incorrect or at least surprising: it 
> would
> resolve file names relative to the current directory instead of 
> relative
> to the directory that contains the source file.
>

Sure, in my config I use `with-directory-excursion`, so `getcwd` 
returns correct values.

Anyway, the reason I replied was that I am also a former Stow user 
and in my eyes we should've extended existing 
`home-files-service-type` instead of making a specialized new one. 
If you check `stow` manual 
(https://www.gnu.org/software/stow/manual/html_node/Invoking-Stow.html#Invoking-Stow), 
it should be invoked with the names of packages to be 
installed/removed. `home-dotfiles-service` doesn't have a 
parameter for the list of packages and assumes that everything in 
the specified directory should be installed, a limitation that 
prevents me to start using it. In my dotfiles I have optional 
packages which I install depending on OS or machine's purpose. 
Sure the service could be amended with the said parameter, but why 
adding a new service when a more generic one exists and is fitting 
the use case?




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

Previous Next


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