From patchwork Thu Mar 31 11:09:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 38246 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 3B82D27BBEA; Thu, 31 Mar 2022 12:12:33 +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 0073327BBE9 for ; Thu, 31 Mar 2022 12:12:33 +0100 (BST) Received: from localhost ([::1]:37710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZsjA-0002nX-2U for patchwork@mira.cbaines.net; Thu, 31 Mar 2022 07:12:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZshj-0001fU-05 for guix-patches@gnu.org; Thu, 31 Mar 2022 07:11:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZshi-0003Ue-MI for guix-patches@gnu.org; Thu, 31 Mar 2022 07:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nZshi-0002Df-GW for guix-patches@gnu.org; Thu, 31 Mar 2022 07:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54393] [PATCH v2 2/3] environment: Export 'load-manifest'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 31 Mar 2022 11:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54393 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54393@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 54393-submit@debbugs.gnu.org id=B54393.16487250438401 (code B ref 54393); Thu, 31 Mar 2022 11:11:02 +0000 Received: (at 54393) by debbugs.gnu.org; 31 Mar 2022 11:10:43 +0000 Received: from localhost ([127.0.0.1]:38022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZshO-0002BM-J2 for submit@debbugs.gnu.org; Thu, 31 Mar 2022 07:10:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZsh9-00029X-Qu for 54393@debbugs.gnu.org; Thu, 31 Mar 2022 07:10:29 -0400 Received: from [2001:470:142:3::e] (port=54756 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZsh1-0003Ax-2O; Thu, 31 Mar 2022 07:10:21 -0400 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=ftje0oZhs3dbyxdssEuCqh3SAJIOifxIjLCBnxr9k2M=; b=W8l0/GAq1xbVKiXa5DP0 ZLKBjnZ93jA1yLRBs7qH8EEybaeGlX8bFDrVEhb5hfTE2FPhbEpzoIXPBmLGVQTDEKWO6pHMOQpis yu39Xm6fCLA57XLR4XeQ6MU9sGhoaAh1+wswZJgpUFO6tdxYaFK4ky62ByxxedJ2V6rCg4rkx/fGj 1CrVoOBM436eNe4PAG5OouG1/c4QOzFE8LyMT46Txmz66nV/9D0PdNpxNRYDuV5r37Wp2b2ao8AZF ah0dAVQLXypwAZM6L6JnM+KlLoGozV5S59CJCuAFezB/9pyQ/CFOFKhk/1jEpcIn1gV7w+Q8b+YDn PFCX+vWG1ompzw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:61384 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 1nZsh0-0002dj-Js; Thu, 31 Mar 2022 07:10:18 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 31 Mar 2022 13:09:56 +0200 Message-Id: <20220331110957.31829-2-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220331110957.31829-1-ludo@gnu.org> References: <87r173huph.fsf@gnu.org> <20220331110957.31829-1-ludo@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" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/environment.scm (load-manifest): New procedure. (options/resolve-packages): Use it. --- guix/scripts/environment.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index ec071402f4..07b54cd89b 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -56,6 +56,7 @@ (define-module (guix scripts environment) #:use-module (srfi srfi-37) #:use-module (srfi srfi-98) #:export (assert-container-features + load-manifest guix-environment guix-environment* show-environment-options-help @@ -285,6 +286,11 @@ (define same-key? (cut eq? key <>)) (_ memo))) '() alist)) +(define (load-manifest file) ;TODO: factorize + "Load the user-profile manifest (Scheme code) from FILE and return it." + (let ((user-module (make-user-module '((guix profiles) (gnu))))) + (load* file user-module))) + (define (options/resolve-packages store opts) "Return OPTS with package specification strings replaced by manifest entries for the corresponding packages." @@ -331,8 +337,7 @@ (define (packages->outputs packages mode) (let ((module (make-user-module '()))) (packages->outputs (load* file module) mode))) (('manifest . file) - (let ((module (make-user-module '((guix profiles) (gnu))))) - (manifest-entries (load* file module)))) + (manifest-entries (load-manifest file))) (_ '())) opts) manifest-entry=?)))