From patchwork Fri Nov 29 09:40:08 2024 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: 34207 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 19A3C27BBE2; Fri, 29 Nov 2024 09:42:44 +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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, 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 27D6B27BBE2 for ; Fri, 29 Nov 2024 09:42:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGxW4-0000fn-2q; Fri, 29 Nov 2024 04:42:25 -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 1tGxVk-0000eJ-Br for guix-patches@gnu.org; Fri, 29 Nov 2024 04:42:05 -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 1tGxVj-0004Wn-Qd; Fri, 29 Nov 2024 04:42:04 -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=sRa6bR3/KIcdvkERLdj6EUGBUx1hjMUxRRdpOyErb+zLylUiYuFXD+5voeQtZsdhRLAIG7ZNuzh/mjrgVdm0CbmkI5TfoqeCorNq5bfu1U56iMvyEpzvxWYuyivCD7rVFK6NeJ8Ky6FTdnrbK85bXP245gHGhbOh2UCzKGrzSKuAIt0MnbpaEEYxradeJCIhQv8dH7acJGg/YQrSoOOCg6EbfQAaV85LIEdOpctQCm1eBUWDpyeuwdilzSRHYyNjvZALQmH59Vm1lvyFsvIMdcTjYFcQFbl5Vh2zHu0+2z4rmnvUai9JuWESBMZbsfsU64PQ4OmZTttBdnEkFGljqw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGxVj-0005wH-9c; Fri, 29 Nov 2024 04:42:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74542] [PATCH v2 05/16] packages: Factorize =?utf-8?b?4oCYYWxs?= =?utf-8?b?LXBhY2thZ2Vz4oCZLg==?= 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: Fri, 29 Nov 2024 09:42:03 +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 =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74542-submit@debbugs.gnu.org id=B74542.173287326822602 (code B ref 74542); Fri, 29 Nov 2024 09:42:03 +0000 Received: (at 74542) by debbugs.gnu.org; 29 Nov 2024 09:41:08 +0000 Received: from localhost ([127.0.0.1]:41044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGxUo-0005sC-OW for submit@debbugs.gnu.org; Fri, 29 Nov 2024 04:41:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGxUd-0005pd-7U for 74542@debbugs.gnu.org; Fri, 29 Nov 2024 04:40:56 -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 1tGxUW-0003nf-TG; Fri, 29 Nov 2024 04:40:50 -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=VIeO0P2m7ruh6p1JsrC8 qnX3Yn0GRbQ7s6Rz5K4wpFDtgIBGTB3LGZDGK6vf8RktneDSptSnBkLpO87fhMQOC+Nn8SQ4Dpgm/ UBLt8rxBjY03VVj+2DV1iTrWbX5PevVBoZjaqh0hzeRyEjwkVYvuwg4vB2dFhgBj+ExYUoqsdL0yq IT+r3bXbOeK6aKl1dc5RFSA3/ao8unJzoU9D/2sGgM6AVf8iucE5yGjxyIrTiSDnUQzgS2wlccPUV tWYpBsGoZ72ugeyrwGanGKy+gfh3DZrdmfnD4foP3WMBQA7bwl4ULEid6WvgUv36xMg5hd0YfTWnX Z+LUvQIPAPfugg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 29 Nov 2024 10:40:08 +0100 Message-ID: <8bcbbc485aa264424b29ea873fee3e2b6aa30008.1732872498.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: 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 * 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."