From patchwork Mon Dec 4 14:15:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 57286 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2054427BBE9; Mon, 4 Dec 2023 14:17:29 +0000 (GMT) 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 18DD827BBE2 for ; Mon, 4 Dec 2023 14:17:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rA9kp-0006ip-6y; Mon, 04 Dec 2023 09:16:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rA9kl-0006eB-5f for guix-patches@gnu.org; Mon, 04 Dec 2023 09:16:56 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rA9kk-0007Ww-5B; Mon, 04 Dec 2023 09:16:54 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rA9kt-0007gb-JT; Mon, 04 Dec 2023 09:17:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67072] [PATCH v2 3/4] weather: Use the same substitute URLs as guix-daemon. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 04 Dec 2023 14:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67072@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 67072-submit@debbugs.gnu.org id=B67072.170169940029468 (code B ref 67072); Mon, 04 Dec 2023 14:17:03 +0000 Received: (at 67072) by debbugs.gnu.org; 4 Dec 2023 14:16:40 +0000 Received: from localhost ([127.0.0.1]:33766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rA9kV-0007fE-FT for submit@debbugs.gnu.org; Mon, 04 Dec 2023 09:16:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rA9kT-0007ea-13 for 67072@debbugs.gnu.org; Mon, 04 Dec 2023 09:16:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rA9kB-0007TP-NZ; Mon, 04 Dec 2023 09:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ZfGlG5r29Z9pXRIJGfGbJeOdLH7NNEOjDlwC65hUMe0=; b=I/yjcG4ZRGcWkhMEBtox 8Cs1ncmAYLHcMI0BMy0DkjGbKe3ZSO3DFHGcJCC7gQZSPxuqqeLSHFgWzQDmX9gfBIaPpjKT8aFb/ 90xBAAsMxJPG0bEEllx0Ed/LrfC66ynKO+kVHJynbeWhMJQyk86/TDnJNicTtYuWiyk45ftZnNyfW qCiy3zjTKSxnzCWIRcv47igVzW04W80NySz1cL70SMX35XiozVoUPrZhgGkgEIEMvZyr4UW/c3qxZ 93A49t/sy53h+TEwnPi5OmhaQsvBQGLRTjT6RpzMJPvX70M17Qtc+qj/Zrwi4WaQ03zaOPBfdfd2V l9qybyQUHZp7MQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 4 Dec 2023 15:15:44 +0100 Message-ID: <27ea9197f90933c2c53ebe57e1406c70f4a165ab.1701699075.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <875y1gj47u.fsf@gnu.org> References: <875y1gj47u.fsf@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/scripts/weather.scm (%default-options): Remove ‘substitute-urls’. (guix-weather): Call ‘substitute-urls’ when OPTS doesn’t have it. Warn when ‘substitute-urls’ returns #f. * doc/guix.texi (Invoking guix weather): Adjust accordingly. Change-Id: I3e9100074f2ad559e5c408660db70430d64f2bef --- doc/guix.texi | 5 +++-- guix/scripts/weather.scm | 12 +++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1fd2e21608..74739c5392 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16504,8 +16504,9 @@ Invoking guix weather @table @code @item --substitute-urls=@var{urls} @var{urls} is the space-separated list of substitute server URLs to -query. When this option is omitted, the default set of substitute -servers is queried. +query. When this option is omitted, the URLs specified with the +@option{--substitute-urls} option of @command{guix-daemon} are used or, +as a last resort, the default set of substitute URLs. @item --system=@var{system} @itemx -s @var{system} diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 140df3435f..7e302fcea7 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017-2022 Ludovic Courtès +;;; Copyright © 2017-2023 Ludovic Courtès ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2018 Kyle Meyer ;;; Copyright © 2020 Simon Tournier @@ -391,7 +391,7 @@ (define %options %standard-native-build-options)) (define %default-options - `((substitute-urls . ,%default-substitute-urls))) + '()) (define (load-manifest file) "Load the manifest from FILE and return the list of packages it refers to." @@ -582,7 +582,13 @@ (define-command (guix-weather . args) (let* ((opts (parse-command-line args %options (list %default-options) #:build-options? #f)) - (urls (assoc-ref opts 'substitute-urls)) + (urls (or (assoc-ref opts 'substitute-urls) + (with-store store + (substitute-urls store)) + (begin + (warning (G_ "could not determine current \ +substitute URLs; using defaults~%")) + %default-substitute-urls))) (systems (match (filter-map (match-lambda (('system . system) system) (_ #f))