summaryrefslogtreecommitdiff
path: root/gnu/installer
diff options
context:
space:
mode:
authorRutherther <rutherther@ditigal.xyz>2025-09-05 20:03:55 +0200
committerLudovic Courtès <ludo@gnu.org>2025-10-17 12:23:54 +0200
commit55584781e939d62d87b3f46350a359673b181691 (patch)
tree4843e184b1b814412226db6391e431c56e24a95d /gnu/installer
parente59a33a6c091bf640e4d15930b8a7f4f1c88b2ae (diff)
installer: wait-service-online: More urls to check user is online.
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 <ludo@gnu.org>
Diffstat (limited to 'gnu/installer')
-rw-r--r--gnu/installer/newt/network.scm43
1 files changed, 24 insertions, 19 deletions
diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm
index 8a2ad84e0db..0b91bda5f87 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))