bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43736: The local-file()'s error message is misleading.


From: Ludovic Courtès
Subject: bug#43736: The local-file()'s error message is misleading.
Date: Fri, 02 Oct 2020 08:14:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

"Vitaliy Shatrov" <guix.vits@disroot.org> skribis:

> ;; (define (custom-local-file str)              ; shorthand, preserves 
> permissions
> ;;   (let* ((file (local-file str #:recursive? #t))
> ;;       (dir (dirname (local-file-absolute-file-name file))))
> ;;     (display (string-append "loading local file '" str "' from " dir 
> "...\n"))
> ;;     file))

[...]

> ;;      (auto-login (custom-local-file "auto-login"))
> ;;      (syslog.conf (custom-local-file "syslog.conf")))

This will not have the desired effect.  ‘local-file’ is special syntax:
it captures the source directory so that at run time it can resolve file
names relative to the source directory.

The ‘custom-local-file’ procedure does not do that.  Consequently, file
names get resolved relative to $PWD instead.

Commit f43ffee90882c2d61b46d69728daa7432be297e4 improves on that by
emitting a warning at run time when ‘local-file’ is passed a non-literal
relative file name.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]