From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kHEJE3ffbWU+KQAAauVa8A:P1 (envelope-from ) for ; Mon, 04 Dec 2023 15:17:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kHEJE3ffbWU+KQAAauVa8A (envelope-from ) for ; Mon, 04 Dec 2023 15:17:27 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 352BD5F5EA for ; Mon, 4 Dec 2023 15:17:27 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="I/yjcG4Z"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701699447; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZfGlG5r29Z9pXRIJGfGbJeOdLH7NNEOjDlwC65hUMe0=; b=C/w+5zb7rROwBhDXprWZnXUyIxPj4+GOsRguZztSFsU6EhhvH26AlxnDHvP05Z7ZAbQfp1 HpFj55kDPTxOcyKhoRuuFmVtAQlQ2E2AhMdr4KhxiC77O/u/6GXA6eNH5DTT2c1nSKsaXw Svm+G0HPXDKflYfyB544WHNpmr+EVzuRLQBKyFVsM0Lxnh7mkCwtOe+0ewr78ZaLfGPWX2 Ug2rw8Ri1y7xeqeSb6w7RluCDCM4A4kOqkUQOwu60xChqrpfW02nfy4le3fl9nFLu5i3lY esSTCL4Ri1dfObCiXePLtji4v/cH4ErI51viEA0/altYMW94SICf8YxpOmcjtA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="I/yjcG4Z"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701699447; a=rsa-sha256; cv=none; b=hVhBqnn23oMVPidIEAmMlMF6i+xnBj5L5q2uhaK2X9kHM6BZN8LmUPxNSgYnY0dzktpNu0 OsQbFUxQgL/4jBEtbTlz7uXljOtszaGdE2JAGc3+9yQJq2OIeqBfip0Cjj2+DOi/KBhkhI VCyKuTAYE7fDOjGx7omVooJrKbLwPqDQKjhu9sgrxATWhzKTlc4xhod4+2XcCO8n4N8HkF PlME6tXQO8M4rPbkEpYKtlDKP6jo2re8bePnTtGBzfQjP80G7PBzlKLz3X6I3lhJq8jE0m xSrb/AP1TdIqUyUiSkab3Kt9ReLj77FaiomwfV3uyGA7+YBk81Qj5UTmSEU7fQ== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.34 X-Spam-Score: -4.34 X-Migadu-Queue-Id: 352BD5F5EA X-Migadu-Scanner: mx12.migadu.com X-TUID: 0Rt89jI6ZAz2 * 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)) -- 2.41.0