From patchwork Fri Jul 8 09:27:50 2022 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: 40597 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 80A0B27BBEA; Fri, 8 Jul 2022 10:30:16 +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 EA34827BBE9 for ; Fri, 8 Jul 2022 10:30:15 +0100 (BST) Received: from localhost ([::1]:50884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9kJT-0007ez-4X for patchwork@mira.cbaines.net; Fri, 08 Jul 2022 05:30:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9kJI-0007ek-7r for guix-patches@gnu.org; Fri, 08 Jul 2022 05:30:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9kJH-0000Ey-RF for guix-patches@gnu.org; Fri, 08 Jul 2022 05:30:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9kJH-0004l2-IY for guix-patches@gnu.org; Fri, 08 Jul 2022 05:30:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56446] [PATCH] profiles: Remove support for reading versions 0 and 1. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Jul 2022 09:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56446 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56446@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165727255318116 (code B ref -1); Fri, 08 Jul 2022 09:30:03 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jul 2022 09:29:13 +0000 Received: from localhost ([127.0.0.1]:58846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9kIT-0004i8-IR for submit@debbugs.gnu.org; Fri, 08 Jul 2022 05:29:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:48636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9kIQ-0004hy-Nc for submit@debbugs.gnu.org; Fri, 08 Jul 2022 05:29:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9kIQ-0007c7-EX for guix-patches@gnu.org; Fri, 08 Jul 2022 05:29:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44442) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9kIP-0008U1-FU; Fri, 08 Jul 2022 05:29:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=Oc2fA7RfisGqH22qY8ZBRpsglJBFVAtEBvbAaZ77cSk=; b=Nxvizxjex1bzkJ KFOkCevIk1leBSvAqQN+aA/E2+zQg/1jzE11UONtNfmSX+T0FyDg0AxdhJaRUh2YZj3z9CnaP8QGP tgf/inPfCXzUUP7UTHYaRWHKjQlTB/6Cv0n26vH6U6hEcLv2UZufZro3oa6x5e+7g2us0y/EGg5IB KQImoFkdst+Ev9+D7qviD5EuhmWZNknnt1BKfoURbstVrYdTkfDJpmnFWpMpvtM9eXJA9RKmrKJYd 0IhHaL1zytRBH5kK+oLEK2uoC+mZvdWKnQqVYxPTLLwvggMkc7YBr+ZYW34UvqgxoO4JjRBGmkUCv +0ZvTtvqnmp51w11l6vA==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=39680 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9kIO-0005lr-PC; Fri, 08 Jul 2022 05:29:09 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 8 Jul 2022 11:27:50 +0200 Message-Id: <20220708092750.918-1-ludo@gnu.org> X-Mailer: git-send-email 2.36.1 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" X-getmail-retrieved-from-mailbox: Patches Version 2 was introduced in commit dedb17ad010ee9ef67f3f4f3997dd17f226c8090 (May 2015), which made it into Guix 0.9.0. * guix/profiles.scm (find-package): Remove. (sexp->manifest)[infer-search-paths]: Remove. Remove clauses for versions 0 and 1. --- guix/profiles.scm | 65 +---------------------------------------------- 1 file changed, 1 insertion(+), 64 deletions(-) Hi, This change will make it impossible to read profiles created before 2015, which was way before 1.0. I’ll go ahead and apply it if there are no objections. Thanks, Ludo’. base-commit: 43cf8861b8ff3e8b987b731f347e31ba8bdf00ae diff --git a/guix/profiles.scm b/guix/profiles.scm index 701852ae98..a21cc432dc 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -507,34 +507,8 @@ (define (entry->gexp entry) (mapm %state-monad entry->gexp entries) vlist-null)))))) -(define (find-package name version) - "Return a package from the distro matching NAME and possibly VERSION. This -procedure is here for backward-compatibility and will eventually vanish." - (define find-best-packages-by-name ;break abstractions - (module-ref (resolve-interface '(gnu packages)) - 'find-best-packages-by-name)) - - ;; Use 'find-best-packages-by-name' and not 'find-packages-by-name'; the - ;; former traverses the module tree only once and then allows for efficient - ;; access via a vhash. - (match (find-best-packages-by-name name version) - ((p _ ...) p) - (_ - (match (find-best-packages-by-name name #f) - ((p _ ...) p) - (_ #f))))) - (define (sexp->manifest sexp) "Parse SEXP as a manifest." - (define (infer-search-paths name version) - ;; Infer the search path specifications for NAME-VERSION by looking up a - ;; same-named package in the distro. Useful for the old manifest formats - ;; that did not store search path info. - (let ((package (find-package name version))) - (if package - (package-native-search-paths package) - '()))) - (define (infer-dependency item parent) ;; Return a for ITEM. (let-values (((name version) @@ -620,44 +594,7 @@ (define* (sexp->manifest-entry sexp #:optional (parent (delay #f))) (return entry))))))) (match sexp - (('manifest ('version 0) - ('packages ((name version output path) ...))) - (manifest - (map (lambda (name version output path) - (manifest-entry - (name name) - (version version) - (output output) - (item path) - (search-paths (infer-search-paths name version)))) - name version output path))) - - ;; Version 1 adds a list of propagated inputs to the - ;; name/version/output/path tuples. - (('manifest ('version 1) - ('packages ((name version output path deps) ...))) - (manifest - (map (lambda (name version output path deps) - ;; Up to Guix 0.7 included, dependencies were listed as ("gmp" - ;; "/gnu/store/...-gmp") for instance. Discard the 'label' in - ;; such lists. - (let ((deps (match deps - (((labels directories) ...) - directories) - ((directories ...) - directories)))) - (letrec* ((deps* (map (cute infer-dependency <> (delay entry)) - deps)) - (entry (manifest-entry - (name name) - (version version) - (output output) - (item path) - (dependencies deps*) - (search-paths - (infer-search-paths name version))))) - entry))) - name version output path deps))) + ;; Versions 0 and 1 are no longer produced since 2015. ;; Version 2 adds search paths and is slightly more verbose. (('manifest ('version 2 minor-version ...)