From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: Store channel specification in profile Date: Tue, 11 Feb 2020 15:18:03 +0100 Message-ID: <87imkdky1w.fsf@ambrevar.xyz> References: <87blsyelgm.fsf@ambrevar.xyz> <87tv69bezo.fsf@gnu.org> <87zhg1xvmo.fsf@ambrevar.xyz> <874kx8gxh1.fsf@ambrevar.xyz> <87blreasgd.fsf@ambrevar.xyz> <87pnfpsgfx.fsf@gnu.org> <87a76rqu5j.fsf@ambrevar.xyz> <877e1vqowd.fsf@ambrevar.xyz> <87zhe4px2a.fsf@ambrevar.xyz> <87wo91p9yt.fsf@gnu.org> <87eev8gewx.fsf@ambrevar.xyz> <87pneq140d.fsf@gnu.org> <8736bldmzr.fsf@ambrevar.xyz> <87zhdp2p16.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:49167) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1WMa-0005PW-M2 for guix-devel@gnu.org; Tue, 11 Feb 2020 09:18:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1WMZ-0004f0-3D for guix-devel@gnu.org; Tue, 11 Feb 2020 09:18:08 -0500 In-Reply-To: <87zhdp2p16.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Guix Devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: >> Same thing, what I had in mind was to store the version number in the >> _serialized_ specifications.scm, as for the manifest. >> >> This way I believe we can support multiple version for specifications.sc= m. >> Am I missing something? > > Then I don=E2=80=99t get how =E2=80=98specifications.scm=E2=80=99 would d= iffer from =E2=80=98manifest=E2=80=99. > In both cases we=E2=80=99re talking about a serialization format containi= ng > per-package provenance info, right? The main differences: =2D specifications.scm is a good fit to the --manifest argument. =2D specifications.scm is human-editable because it does not contain fields like the store path. >> Yes, so I'll try to sum up what I want to achieve in one sentence: >> "automate the textual serialization of profile specifications to >> simplify their backup/deployment/reproduction". > > OK. > > To me, serialization is already automated: it=E2=80=99s the =E2=80=98mani= fest=E2=80=99 file. > > What we lack is the ability to obtain a =E2=80=9Cmanifest.scm=E2=80=9D ki= nd of file > (code) that users can pick as a starting point in their migration > towards declarative deployment. You mean a script like the following? =2D-8<---------------cut here---------------start------------->8--- ;; Run with: ;; guile -s FILE ~/.guix-profile (use-modules (guix profiles) (gnu packages) ; fold-packages (guix packages) ; package structure (ice-9 match) (ice-9 pretty-print)) (define (packages-by-name name) (fold-packages (lambda (package list) (if (string=3D? (package-name package) name) (cons package list) list)) '())) (define (guix-manifest where) (sort (map (lambda (entry) (let* ((name (manifest-entry-name entry)) (out (manifest-entry-output entry)) (version (manifest-entry-version entry)) (default-version (match (packages-by-name name) ((first-name . rest) (package-version first-name)) (else #f)))) (string-append name (if (and default-version (not (string=3D version default-ve= rsion))) (format #f "@~a" version) "") (if (string=3D out "out") "" (format #f ":~a" out))))) (manifest-entries (profile-manifest where))) stringmanifest ',(guix-manifest where)))) (_ (error "Please provide the path to a Guix profile."))) =2D-8<---------------cut here---------------end--------------->8--- =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5Ct5sACgkQm9z0l6S7 zH9kOAf/TFfN4sL1d9SbLdJ1jeBaTg2sy/bTt3mnNDubhfs7me8XvRsYBiii+otP /fvue8Nw2picrnMSePQhfytCmQlCWV/sa5xd/2+VlS/ytnXmV4WLAQxabFe/qfL6 2BLib5vgXr0M5jepwBbDG0qK8ZDFnS4+tHunqLdHVxjtkTxjtz2jYBCajvLQXSI3 yu2lMVPOZFxnOs6n+3GTRuq2AqnyGFEjcItEwoxeZt3cGfmd27BeeT4sYPmcG7/W 4mJvzsIh9vCPNcvOm4evC7tjuDqQV3R4nN4sP1D04+nWZ28O2RkMTmuL63FdPXoa SjVzJWYf0D2nzK9+WsEJk3ZT27LvHg== =R1NL -----END PGP SIGNATURE----- --=-=-=--