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 #147 received at 60521 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
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:20:10 +0100
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.

Ludo’.




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.