From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:43674) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXQJ2-0000Lr-3z for guix-patches@gnu.org; Wed, 20 Nov 2019 08:46:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXQJ1-0007YM-5L for guix-patches@gnu.org; Wed, 20 Nov 2019 08:46:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40340) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXQJ1-0007YC-0Q for guix-patches@gnu.org; Wed, 20 Nov 2019 08:46:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iXQJ0-0007Gb-Fd for guix-patches@gnu.org; Wed, 20 Nov 2019 08:46:02 -0500 Subject: [bug#38301] [PATCH 2/4] profiles: Add 'concatenate-manifests'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 20 Nov 2019 14:44:35 +0100 Message-Id: <20191120134437.30881-2-ludo@gnu.org> In-Reply-To: <20191120134437.30881-1-ludo@gnu.org> References: <20191120134437.30881-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38301@debbugs.gnu.org Cc: Konrad Hinsen , Pierre Neidhardt , Ludovic =?UTF-8?Q?Court=C3=A8s?= * guix/profiles.scm (concatenate-manifests): New procedure. * tests/profiles.scm ("concatenate-manifests"): New test. --- guix/profiles.scm | 5 +++++ tests/profiles.scm | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/guix/profiles.scm b/guix/profiles.scm index cd3b21e390..f5e5cc33d6 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -92,6 +92,7 @@ manifest-pattern-version manifest-pattern-output + concatenate-manifests manifest-remove manifest-add manifest-lookup @@ -515,6 +516,10 @@ procedure is here for backward-compatibility and will eventually vanish." "Return the packages listed in MANIFEST." (sexp->manifest (read port))) +(define (concatenate-manifests lst) + "Concatenate the manifests listed in LST and return the resulting manifest." + (manifest (append-map manifest-entries lst))) + (define (entry-predicate pattern) "Return a procedure that returns #t when passed a manifest entry that matches NAME/OUTPUT/VERSION. OUTPUT and VERSION may be #f, in which case they diff --git a/tests/profiles.scm b/tests/profiles.scm index a4e28672b5..21c912a532 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -113,6 +113,11 @@ (manifest-matching-entries m (list p)) #f))) +(test-equal "concatenate-manifests" + (manifest (list guile-2.0.9 glibc)) + (concatenate-manifests (list (manifest (list guile-2.0.9)) + (manifest (list glibc))))) + (test-assert "manifest-remove" (let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug))) (m1 (manifest-remove m0 -- 2.24.0