From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sDn7H+ukRWcsFAAA62LTzQ:P1 (envelope-from ) for ; Tue, 26 Nov 2024 10:37:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sDn7H+ukRWcsFAAA62LTzQ (envelope-from ) for ; Tue, 26 Nov 2024 11:37:31 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=s4XgT3Zz; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=P8Ia4mWf; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732617451; a=rsa-sha256; cv=none; b=rHQHE6DDWOwmVAXuweLFrceagEzn9oVMaIMGq286PvftvkSqH4jh30qmXjFOJ/A5OcuyVy S5MZgfTusLdRNWiVD8sTgmhowaB4T1DqeM87nm5M0oYJUqo+kIPSikmbAvDBfU8iY8eosl H+eqDs1BP+x8V6OXSCnLIwDeglU27CBRmzxyNIh7svfW9U5nrLAHAUshPh0Z/836/gFFZP RsjGfGB/oflYe69Ojw0bFZ7y6SPw+yJbL4AgayIleIUij2UjA7vh/AB7BCitccBiiZyZr8 jCc9V7MMh5nF8dT6BYVFkvT2L9Q5JAhBFdRtHWBhqSWkaF1eURKXXV54w5nmQA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=s4XgT3Zz; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=P8Ia4mWf; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732617451; 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=fVG6zE1g5+COgLKTSq6q72yUelSVfBfqbZ9R64BW7Zw=; b=WZg9LZAQvsrK//oxYfa3cO5FTlQz5uTWaTppN4BOmSoaadMVH/ayDscBsSfPsAkUXedCzX S00cXe25xPuwGN6xLE5OkSMWZ/Sn2QSYUHaOowkMw5v/O2qkACFyiylbhnOyeLFjmiqNZI I3Mu4CEzYmx9hak0OtX/GsT1b91omIP7WWAvOPXQn0Ixm+zbKnnDFnQjdNxNX/ZgAqoPpt qnLi+749LVpdhD6P++I76R4u0ZK3pjKcxZRpdrlGj0T7dYcEP+aeRm1kNu9kXrUqO6NUqN Z8H2ira7AaMSFBVIrA7v9gou5RG3Ohq4xrM2q2d7JoYFMpbwAOwFqadVsVBbzw== 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 0DD947285C for ; Tue, 26 Nov 2024 11:37:30 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFswY-0005Jp-BH; Tue, 26 Nov 2024 05:37:18 -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 1tFswM-0005Il-G2 for guix-patches@gnu.org; Tue, 26 Nov 2024 05:37:08 -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 1tFswM-0000pd-6g; Tue, 26 Nov 2024 05:37:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=fVG6zE1g5+COgLKTSq6q72yUelSVfBfqbZ9R64BW7Zw=; b=s4XgT3ZzFGoXypnOvqdGHMT7fTdO74xdbArfprxgik7OoTL/M/HK2IojBbeSBQxiyGqZ4gINioC1DA0A3sn4choKok4PDNGT7Asa8nEVj1c0ufbNkZ+S7ZbgMkdZ4R1g+U7p8dUp4S2F+otSKPwNba4S8ZQF90dDkKUa5CWNzLxAv6/SMT6mWo+jyZMjzxAKvM9I58IyKwyoiJThGSgqW1XZCtgFaYzWwiYKY7Oss5iB9LMJKUNbNwFtuwR8vxZpk1BIkt4u7lLxLpySOrPOL9DK662mSkDvqib2q2IBcUTFdH1MRvHJdZWBjE35I8OxgAP+8XT8BhdlM4leeTIWnQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFswK-0002eF-8N; Tue, 26 Nov 2024 05:37:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74542] [PATCH 05/11] packages: Factorize =?UTF-8?Q?=E2=80=98all-packages=E2=80=99.?= 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 26 Nov 2024 10:37:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74542 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74542@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic Court?s , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic Court?s , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74542-submit@debbugs.gnu.org id=B74542.173261740510081 (code B ref 74542); Tue, 26 Nov 2024 10:37:04 +0000 Received: (at 74542) by debbugs.gnu.org; 26 Nov 2024 10:36:45 +0000 Received: from localhost ([127.0.0.1]:46202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFsw0-0002cV-Vv for submit@debbugs.gnu.org; Tue, 26 Nov 2024 05:36:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFsvo-0002ae-5V for 74542@debbugs.gnu.org; Tue, 26 Nov 2024 05:36:32 -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 1tFsta-00006Y-U0; Tue, 26 Nov 2024 05:34:14 -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=fVG6zE1g5+COgLKTSq6q72yUelSVfBfqbZ9R64BW7Zw=; b=P8Ia4mWfmBwTQczy4ko6 D5yj8KuzmqjgxwB5l8GlEyivMrwR4m9mVGg4lvvs44RLYvyywC9CRv/RbC87hGRS6bjfNeHg+dtOX kiS5D3dTyIzE8N+75nH8twjcEPq20yjis65O2kesFgezMwVzSiNYpZE69nR6Yboknal0Bsl56fPNb T90LwQEPp6h/eSbKTziv35XS9iijyPnqdwWs8vTBSNEKlYPPVXU6qhdFcC0P7NVlk8Uzbp7UB88g6 eORR1IVXWxz3TvvpCFCQL49EK3kvC3JsFJiJcNNnbBApVeCCKPDXh4nbP1yRntNLqujyeclStwfaF X+Df8ePaHR2+rQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 26 Nov 2024 11:33:44 +0100 Message-ID: <21b5368441ff34f5a54b78550b87d97ca765785e.1732615193.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.79 X-Spam-Score: -4.79 X-Migadu-Queue-Id: 0DD947285C X-Migadu-Scanner: mx10.migadu.com X-TUID: nIae/UeMlBgm * gnu/packages.scm (all-packages): New procedure. * etc/source-manifest.scm (all-packages): Remove. * guix/scripts/graph.scm (all-packages): Remove. * guix/scripts/refresh.scm (all-packages): Remove. * guix/scripts/weather.scm (all-packages): Remove. Change-Id: I6072952c4b877b541037ce86402cfb7744eeb0a0 --- etc/source-manifest.scm | 13 +------------ gnu/packages.scm | 20 +++++++++++++++++++- guix/scripts/graph.scm | 10 ---------- guix/scripts/refresh.scm | 10 ---------- guix/scripts/weather.scm | 15 --------------- 5 files changed, 20 insertions(+), 48 deletions(-) diff --git a/etc/source-manifest.scm b/etc/source-manifest.scm index f96a5da6f7..3e1ae07959 100644 --- a/etc/source-manifest.scm +++ b/etc/source-manifest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Ludovic Courtès +;;; Copyright © 2021, 2024 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,17 +25,6 @@ (guix packages) (guix profiles) (gnu packages)) -(define (all-packages) - "Return the list of all the packages, public or private, omitting only -superseded packages." - (fold-packages (lambda (package lst) - (match (package-replacement package) - (#f (cons package lst)) - (replacement - (append (list replacement package) lst)))) - '() - #:select? (negate package-superseded))) - (define (upstream-origin source) "Return SOURCE without any patches or snippet." (origin (inherit source) diff --git a/gnu/packages.scm b/gnu/packages.scm index 80c22d1d7f..1af3b8d440 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2020, 2022-2023 Ludovic Courtès +;;; Copyright © 2012-2020, 2022-2024 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2016, 2017 Alex Kost @@ -56,6 +56,7 @@ (define-module (gnu packages) cache-is-authoritative? fold-packages + all-packages fold-available-packages find-newest-available-packages @@ -253,6 +254,23 @@ (define* (fold-packages proc init init modules)) +(define all-packages + (mlambda () + "Return the list of all public packages, including replacements and hidden +packages, excluding superseded packages." + (delete-duplicates + (fold-packages (lambda (package result) + (match (package-replacement package) + ((? package? replacement) + (cons* replacement package result)) + (#f + (cons package result)))) + '() + + ;; Dismiss deprecated packages but keep hidden packages. + #:select? (negate package-superseded)) + eq?))) + (define %package-cache-file ;; Location of the package cache. "/lib/guix/package.cache") diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 6740858d8b..935721edea 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -119,16 +119,6 @@ (define %package-node-type ;;; Reverse package DAG. ;;; -(define (all-packages) ;XXX: duplicated from (guix scripts refresh) - "Return the list of all the distro's packages." - (fold-packages (lambda (package result) - ;; Ignore deprecated packages. - (if (package-superseded package) - result - (cons package result))) - '() - #:select? (const #t))) ;include hidden packages - (define %reverse-package-node-type ;; For this node type we first need to compute the list of packages and the ;; list of back-edges. Since we want to do it only once, we use the diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index ec7d38c22a..8c72d0c545 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -455,16 +455,6 @@ (define* (check-for-package-update update-spec updaters #:key warn?) ;;; Dependents. ;;; -(define (all-packages) - "Return the list of all the distro's packages." - (fold-packages (lambda (package result) - ;; Ignore deprecated packages. - (if (package-superseded package) - result - (cons package result))) - '() - #:select? (const #t))) ;include hidden packages - (define (list-dependents packages) "List all the things that would need to be rebuilt if PACKAGES are changed." ;; Using %BAG-NODE-TYPE is more accurate than using %PACKAGE-NODE-TYPE diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 08a1b22a74..29432fd923 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -55,21 +55,6 @@ (define-module (guix scripts weather) #:use-module (ice-9 vlist) #:export (guix-weather)) -(define (all-packages) - "Return the list of public packages we are going to query." - (delete-duplicates - (fold-packages (lambda (package result) - (match (package-replacement package) - ((? package? replacement) - (cons* replacement package result)) - (#f - (cons package result)))) - '() - - ;; Dismiss deprecated packages but keep hidden packages. - #:select? (negate package-superseded)) - eq?)) - (define (call-with-progress-reporter reporter proc) "This is a variant of 'call-with-progress-reporter' that works with monadic scope." -- 2.46.0