guix-devel
[Top][All Lists]
Advanced

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

Re: how to customize mirror list used in custom channels?


From: Ludovic Courtès
Subject: Re: how to customize mirror list used in custom channels?
Date: Fri, 02 Dec 2022 10:01:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> Does something like that would make sense?

Yes, that’s the idea.

> diff --git a/guix/download.scm b/guix/download.scm
> index 2e9ecb43fc..2497ea0f75 100644
> --- a/guix/download.scm
> +++ b/guix/download.scm
> @@ -499,6 +499,7 @@ (define %download-fallback-test
>  (define* (url-fetch* url hash-algo hash
>                       #:optional name
>                       #:key (system (%current-system))
> +                     (mirrors %mirrors)
>                       (guile (default-guile))
>                       executable?)
>    "Return a fixed-output derivation that fetches data from URL (a string, or 
> a
> @@ -519,7 +520,8 @@ (define file-name
>        (_
>         (basename url))))
>  
> -  (let ((uri (and (string? url) (string->uri url))))
> +  (let ((uri (and (string? url) (string->uri url)))
> +        (mirror-file (plain-file "mirrors" (object->string mirrors))))

There are subtleties though: we don’t want to create a new <plain-file>
at each call as this would lead to poor performance (lack of
memoization).

> This change would a world rebuild, right?

No, not at all.

Thanks,
Ludo’.



reply via email to

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