Message ID | 20221003135547.z4a6ocs7dijgb3nh@barak.in |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7E6AB27BBEA; Mon, 3 Oct 2022 15:37:39 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 35EFC27BBE9 for <patchwork@mira.cbaines.net>; Mon, 3 Oct 2022 15:37:39 +0100 (BST) Received: from localhost ([::1]:38976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1ofMZe-0004O8-DJ for patchwork@mira.cbaines.net; Mon, 03 Oct 2022 10:37:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1ofMId-0006tC-KM for guix-patches@gnu.org; Mon, 03 Oct 2022 10:20:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1ofMId-0007Kt-CF for guix-patches@gnu.org; Mon, 03 Oct 2022 10:20:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1ofMId-0007o6-6N for guix-patches@gnu.org; Mon, 03 Oct 2022 10:20:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58273] [PATCH] installer: checks the availability of the mirror Resent-From: aleksandr barakin <alex@barak.in> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Oct 2022 14:20:03 +0000 Resent-Message-ID: <handler.58273.B.166480676029872@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58273 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58273@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166480676029872 (code B ref -1); Mon, 03 Oct 2022 14:20:03 +0000 Received: (at submit) by debbugs.gnu.org; 3 Oct 2022 14:19:20 +0000 Received: from localhost ([127.0.0.1]:51471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1ofMHu-0007lc-Sc for submit@debbugs.gnu.org; Mon, 03 Oct 2022 10:19:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:53816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <alex@barak.in>) id 1ofLvZ-00075V-Jo for submit@debbugs.gnu.org; Mon, 03 Oct 2022 09:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <alex@barak.in>) id 1ofLvT-0001Li-JW for guix-patches@gnu.org; Mon, 03 Oct 2022 09:56:11 -0400 Received: from forward105p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:108]:45228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <alex@barak.in>) id 1ofLvM-0003z1-J4 for guix-patches@gnu.org; Mon, 03 Oct 2022 09:56:05 -0400 Received: from iva7-38cb93e4c9b7.qloud-c.yandex.net (iva7-38cb93e4c9b7.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:2f93:0:640:38cb:93e4]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 63FEF2FD9371 for <guix-patches@gnu.org>; Mon, 3 Oct 2022 16:55:51 +0300 (MSK) Received: by iva7-38cb93e4c9b7.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id szfGf5mdFU-tohuiVqE; Mon, 03 Oct 2022 16:55:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=barak.in; s=mail; t=1664805350; bh=uCrKyMktnG/GLq7OmF6Vz1AmiHZjD6jQ/atdCO5U7Xs=; h=Message-ID:Subject:To:From:Date; b=IGa3ztfYw8tiHdGIhZVNRlPTQeRP703kmuNdQvSJ4SQXvpVeXcxZzSB7P8lRYbrb5 OY5cn9HENHYOLtGPTNHtO/ELRZuh1uEk3FUgZJ6Eg7ZkQ0HwoNTHvpU+osLloVHgAQ Al7yqQ1BTg+bmqJk9e7TrBbKufpswrd1mGqUyo8c= Authentication-Results: iva7-38cb93e4c9b7.qloud-c.yandex.net; dkim=pass header.i=@barak.in Date: Mon, 3 Oct 2022 16:55:49 +0300 From: aleksandr barakin <alex@barak.in> Message-ID: <20221003135547.z4a6ocs7dijgb3nh@barak.in> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bwfsnjuplwe3pvr7" Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Received-SPF: pass client-ip=2a02:6b8:0:1472:2741:0:8b7:108; envelope-from=alex@barak.in; helo=forward105p.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 03 Oct 2022 10:19:11 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Mon, 03 Oct 2022 10:34:24 -0400 X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#58273] installer: checks the availability of the mirror
|
|
Commit Message
aleksandr barakin
Oct. 3, 2022, 1:55 p.m. UTC
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(-)
Comments
+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.
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 :)
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.
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
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.
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))))