unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58273] [PATCH] installer: checks the availability of the mirror
@ 2022-10-03 13:55 aleksandr barakin
  2022-10-05 10:39 ` [bug#58273] unwox via Guix-patches via
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: aleksandr barakin @ 2022-10-03 13:55 UTC (permalink / raw)
  To: 58273

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

checks the availability of the mirror bordeaux.guix.gnu.org.

this allows you to start the installation if the ci.guix.gnu.org
is unavailable.
---
 gnu/installer/newt/network.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm
index 0477a489be..b11a55cb1f 100644
--- a/gnu/installer/newt/network.scm
+++ b/gnu/installer/newt/network.scm
@@ -122,10 +122,15 @@ FULL-VALUE tentatives, spaced by 1 second."
           (lambda _ #f))
         (alarm 3))
       (lambda ()
-        (false-if-exception
-         (= (response-code
-             (http-request "https://ci.guix.gnu.org"))
-            200)))
+        (or
+          (false-if-exception
+            (= (response-code
+                 (http-request "https://ci.guix.gnu.org"))
+               200))
+          (false-if-exception
+            (= (response-code
+                 (http-request "https://bordeaux.guix.gnu.org"))
+               200))))
       (lambda ()
         (alarm 0))))
 
-- 
2.30.2


-- 
wbr, aleksandr barakin aka sash-kan.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#58273]
  2022-10-03 13:55 [bug#58273] [PATCH] installer: checks the availability of the mirror aleksandr barakin
@ 2022-10-05 10:39 ` unwox via Guix-patches via
  2022-10-14  5:55 ` [bug#58273] [PATCH] installer: checks the availability of the mirror Julien Lepiller
  2022-10-17  5:33 ` Andrew Tropin
  2 siblings, 0 replies; 6+ messages in thread
From: unwox via Guix-patches via @ 2022-10-05 10:39 UTC (permalink / raw)
  To: 58273

+1 for this. It would make guix installation via graphical installer
possible in Russia since ci.guix.gnu.org is not accessible from there
without using proxy.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#58273] [PATCH] installer: checks the availability of the mirror
  2022-10-03 13:55 [bug#58273] [PATCH] installer: checks the availability of the mirror aleksandr barakin
  2022-10-05 10:39 ` [bug#58273] unwox via Guix-patches via
@ 2022-10-14  5:55 ` Julien Lepiller
  2022-10-17  5:33 ` Andrew Tropin
  2 siblings, 0 replies; 6+ messages in thread
From: Julien Lepiller @ 2022-10-14  5:55 UTC (permalink / raw)
  To: aleksandr barakin; +Cc: 58273

Le Mon, 3 Oct 2022 16:55:49 +0300,
aleksandr barakin <alex@barak.in> a écrit :

> checks the availability of the mirror bordeaux.guix.gnu.org.
> 
> this allows you to start the installation if the ci.guix.gnu.org
> is unavailable.

This sounds useful, but I don't know how to test. The patch looks good
and fairly simple to me :)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#58273] [PATCH] installer: checks the availability of the mirror
  2022-10-03 13:55 [bug#58273] [PATCH] installer: checks the availability of the mirror aleksandr barakin
  2022-10-05 10:39 ` [bug#58273] unwox via Guix-patches via
  2022-10-14  5:55 ` [bug#58273] [PATCH] installer: checks the availability of the mirror Julien Lepiller
@ 2022-10-17  5:33 ` Andrew Tropin
  2022-10-17  7:39   ` Mathieu Othacehe
  2 siblings, 1 reply; 6+ messages in thread
From: Andrew Tropin @ 2022-10-17  5:33 UTC (permalink / raw)
  To: aleksandr barakin, 58273

[-- Attachment #1: Type: text/plain, Size: 1830 bytes --]

On 2022-10-03 16:55, aleksandr barakin wrote:

> checks the availability of the mirror bordeaux.guix.gnu.org.
>
> this allows you to start the installation if the ci.guix.gnu.org
> is unavailable.
> ---
>  gnu/installer/newt/network.scm | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm
> index 0477a489be..b11a55cb1f 100644
> --- a/gnu/installer/newt/network.scm
> +++ b/gnu/installer/newt/network.scm
> @@ -122,10 +122,15 @@ FULL-VALUE tentatives, spaced by 1 second."
>            (lambda _ #f))
>          (alarm 3))
>        (lambda ()
> -        (false-if-exception
> -         (= (response-code
> -             (http-request "https://ci.guix.gnu.org"))
> -            200)))
> +        (or
> +          (false-if-exception
> +            (= (response-code
> +                 (http-request "https://ci.guix.gnu.org"))
> +               200))
> +          (false-if-exception
> +            (= (response-code
> +                 (http-request "https://bordeaux.guix.gnu.org"))
> +               200))))
>        (lambda ()
>          (alarm 0))))
>  
> -- 
> 2.30.2

Ideally we should not hardcode exact mirror urls, because the image can
be built with different substitute urls.  Another possible soultion is
to add an ability to skip the check via TUI, as
/tmp/installer-assume-online probably not well-known and this step can
stop people without access to ci.guix.gnu.org from using Guix System,
seems especially true for newcommers.

Anyway, I find this patch useful and good enough to solve the problem at
least for some people (who don't have access to ci, but have it to
bordeaux), adjusted the wording and commit message, applied.

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#58273] [PATCH] installer: checks the availability of the mirror
  2022-10-17  5:33 ` Andrew Tropin
@ 2022-10-17  7:39   ` Mathieu Othacehe
  2022-10-17 12:51     ` Andrew Tropin
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Othacehe @ 2022-10-17  7:39 UTC (permalink / raw)
  To: Andrew Tropin; +Cc: 58273, aleksandr barakin


Hello Andrew,

>> +          (false-if-exception
>> +            (= (response-code
>> +                 (http-request "https://ci.guix.gnu.org"))
>> +               200))
>> +          (false-if-exception
>> +            (= (response-code
>> +                 (http-request "https://bordeaux.guix.gnu.org"))
>> +               200))))

Thanks for taking care of this patch. I think the following part could
be factorized:

(define (url-alive? url)
  (false-if-exception
   (= (response-code
       (http-request url))
      200)))

also, the indentation is wrong. Could you please fix it?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#58273] [PATCH] installer: checks the availability of the mirror
  2022-10-17  7:39   ` Mathieu Othacehe
@ 2022-10-17 12:51     ` Andrew Tropin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Tropin @ 2022-10-17 12:51 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 58273, aleksandr barakin

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On 2022-10-17 09:39, Mathieu Othacehe wrote:

> Hello Andrew,
>
>>> +          (false-if-exception
>>> +            (= (response-code
>>> +                 (http-request "https://ci.guix.gnu.org"))
>>> +               200))
>>> +          (false-if-exception
>>> +            (= (response-code
>>> +                 (http-request "https://bordeaux.guix.gnu.org"))
>>> +               200))))
>
> Thanks for taking care of this patch. I think the following part could
> be factorized:
>
> (define (url-alive? url)
>   (false-if-exception
>    (= (response-code
>        (http-request url))
>       200)))
>
> also, the indentation is wrong. Could you please fix it?

Thank you for the idea, pushed the change.

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-17 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-03 13:55 [bug#58273] [PATCH] installer: checks the availability of the mirror aleksandr barakin
2022-10-05 10:39 ` [bug#58273] unwox via Guix-patches via
2022-10-14  5:55 ` [bug#58273] [PATCH] installer: checks the availability of the mirror Julien Lepiller
2022-10-17  5:33 ` Andrew Tropin
2022-10-17  7:39   ` Mathieu Othacehe
2022-10-17 12:51     ` Andrew Tropin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).