From 55584781e939d62d87b3f46350a359673b181691 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 5 Sep 2025 20:03:55 +0200 Subject: [PATCH] installer: wait-service-online: More urls to check user is online. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provide more space for failure. * gnu/installer/newt/network.scm (wait-service-online) [common-urls-alive?]: Renamed from ci-available? Change-Id: Icf68683dd72c66570eeafaeb0e7871237f0936c9 Signed-off-by: Ludovic Courtès --- gnu/installer/newt/network.scm | 43 +++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index 8a2ad84e0db3361e654f643837d6c134b50fae07..0b91bda5f8725a0cffed3c345dd314a94f16c38b 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -112,30 +112,35 @@ network devices were found. Do you want to continue anyway?")) full-value (+ value 1))))))) +(define (url-alive? url) + (false-if-exception + (begin + (http-request url) + #t))) + +(define (common-urls-alive? urls) + (dynamic-wind + (lambda () + (sigaction SIGALRM + (lambda _ #f)) + (alarm 3)) + (lambda () + (any url-alive? + urls)) + (lambda () + (alarm 0)))) + (define (wait-service-online) "Display a newt scale until connman detects an Internet access. Do FULL-VALUE tentatives, spaced by 1 second." - (define (url-alive? url) - (false-if-exception - (begin - (http-request url) - #t))) - - (define (ci-available?) - (dynamic-wind - (lambda () - (sigaction SIGALRM - (lambda _ #f)) - (alarm 3)) - (lambda () - (or (url-alive? "https://bordeaux.guix.gnu.org") - (url-alive? "https://ci.guix.gnu.org"))) - (lambda () - (alarm 0)))) - (define (online?) (or (and (connman-online?) - (ci-available?)) + (common-urls-alive? + (list + "https://bordeaux.guix.gnu.org" + "https://ci.guix.gnu.org" + "https://guix.gnu.org" + "https://gnu.org"))) (file-exists? "/tmp/installer-assume-online"))) (let* ((full-value 5))