From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d60RS-0006cW-HB for guix-patches@gnu.org; Wed, 03 May 2017 16:00:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d60RP-0006eY-FZ for guix-patches@gnu.org; Wed, 03 May 2017 16:00:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d60RP-0006di-D1 for guix-patches@gnu.org; Wed, 03 May 2017 16:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d60RP-0003nk-64 for guix-patches@gnu.org; Wed, 03 May 2017 16:00:03 -0400 Subject: bug#26652: [PATCH 1/2] profiles: Add manifest->packages. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170425125810.7373-1-m.othacehe@gmail.com> <20170425130024.9481-1-m.othacehe@gmail.com> Date: Wed, 03 May 2017 21:59:40 +0200 In-Reply-To: <20170425130024.9481-1-m.othacehe@gmail.com> (Mathieu Othacehe's message of "Tue, 25 Apr 2017 15:00:23 +0200") Message-ID: <87wp9xr9sj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Mathieu Othacehe Cc: 26652@debbugs.gnu.org Mathieu Othacehe skribis: > * guix/profiles.scm (manifest->packages): New exported procedure. > --- > guix/profiles.scm | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/guix/profiles.scm b/guix/profiles.scm > index eb172ef45..157445407 100644 > --- a/guix/profiles.scm > +++ b/guix/profiles.scm > @@ -8,6 +8,7 @@ > ;;; Copyright =C2=A9 2016 Chris Marusich > ;;; Copyright =C2=A9 2017 Huang Ying > ;;; Copyright =C2=A9 2017 Maxim Cournoyer > +;;; Copyright =C2=A9 2017 Mathieu Othacehe > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -94,6 +95,7 @@ > profile-manifest > package->manifest-entry > packages->manifest > + manifest->packages > ca-certificate-bundle > %default-profile-hooks > profile-derivation > @@ -203,6 +205,14 @@ denoting a specific output of a package." > (package->manifest-entry package))) > packages))) >=20=20 > +(define (manifest->packages manifest) > + "Return the list of packages in MANIFEST." > + (delete-duplicates > + (filter-map (lambda (entry) > + (let ((item (manifest-entry-item entry))) > + (if (package? item) item #f))) > + (manifest-entries manifest)))) You can remove =E2=80=98delete-duplicates=E2=80=99 IMO. Since this procedure has special semantics (it omits non-package-object entries), what about keeping it private in (guix scripts refresh)? Ludo=E2=80=99.