From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:44270) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXSlv-0006PV-NR for guix-patches@gnu.org; Wed, 20 Nov 2019 11:24:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXSlu-0003Ux-Bd for guix-patches@gnu.org; Wed, 20 Nov 2019 11:24:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXSlu-0003Ut-7e for guix-patches@gnu.org; Wed, 20 Nov 2019 11:24:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iXSlu-0002y5-2Y for guix-patches@gnu.org; Wed, 20 Nov 2019 11:24:02 -0500 Subject: [bug#38301] [PATCH 4/4] pack: Allow multiple '--manifest' options. Resent-Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Nov 2019 17:23:07 +0100 From: brettg@posteo.net In-Reply-To: <20191120134437.30881-4-ludo@gnu.org> References: <20191120134437.30881-1-ludo@gnu.org> <20191120134437.30881-4-ludo@gnu.org> Message-ID: 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Guix-patches , Konrad Hinsen , Pierre Neidhardt , 38301@debbugs.gnu.org On 20.11.2019 14:44, Ludovic Court=C3=A8s wrote: > * guix/scripts/pack.scm (guix-pack): Collect 'manifest' options, and > concatenate the resulting manifests. > * tests/guix-pack.sh: Test it. > * doc/guix.texi (Invoking guix pack): Document it. > --- > doc/guix.texi | 3 ++- > guix/scripts/pack.scm | 17 ++++++++++++----- > tests/guix-pack.sh | 11 +++++++++++ > 3 files changed, 25 insertions(+), 6 deletions(-) >=20 > diff --git a/doc/guix.texi b/doc/guix.texi > index 9de1dbd6d5..e702bc3055 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -5178,7 +5178,8 @@ build} (@pxref{Additional Build Options, > @code{--expression} in > @item --manifest=3D@var{file} > @itemx -m @var{file} > Use the packages contained in the manifest object returned by the=20 > Scheme > -code in @var{file}. > +code in @var{file}. This option can be repeated several times, in=20 > which > +case the manifests are concatenated. >=20 > This has a similar purpose as the same-named option in @command{guix > package} (@pxref{profile-manifest, @option{--manifest}}) and uses the > diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm > index 89b3e389fc..c8a52374bd 100644 > --- a/guix/scripts/pack.scm > +++ b/guix/scripts/pack.scm > @@ -965,7 +965,10 @@ Create a bundle of PACKAGE.\n")) > (list (transform store package)=20 > "out"))) > (reverse > (filter-map maybe-package-argument=20 > opts)))) > - (manifest-file (assoc-ref opts 'manifest))) > + (manifests (filter-map (match-lambda > + (('manifest . file) file) > + (_ #f)) > + opts))) > (define properties > (if (assoc-ref opts 'save-provenance?) > (lambda (package) > @@ -979,11 +982,15 @@ Create a bundle of PACKAGE.\n")) > (const '()))) >=20 > (cond > - ((and manifest-file (not (null? packages))) > + ((and (not (null? manifests)) (not (null? packages))) > (leave (G_ "both a manifest and a package list were=20 > given~%"))) > - (manifest-file > - (let ((user-module (make-user-module '((guix profiles)=20 > (gnu))))) > - (load* manifest-file user-module))) > + ((not (null? manifests)) > + (concatenate-manifests > + (map (lambda (file) > + (let ((user-module (make-user-module > + '((guix profiles) (gnu))))) > + (load* file user-module))) > + manifests))) > (else > (manifest > (map (match-lambda > diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh > index cf4e4ca4f9..7a0f3400c3 100644 > --- a/tests/guix-pack.sh > +++ b/tests/guix-pack.sh > @@ -109,3 +109,14 @@ drv1=3D"`guix pack -n guile 2>&1 | grep=20 > pack.*\.drv`" > drv2=3D"`guix pack -n --with-source=3Dguile=3D$test_directory guile 2>&1= | > grep pack.*\.drv`" > test -n "$drv1" > test "$drv1" !=3D "$drv2" > + > +# Try '--manifest' options. > +cat > "$test_directory/manifest1.scm" < +(specifications->manifest '("guile")) > +EOF > +cat > "$test_directory/manifest2.scm" < +(specifications->manifest '("emacs")) > +EOF > +drv=3D"`guix pack -nd -m "$test_directory/manifest1.scm" -m > "$test_directory/manifest2.scm"`" > +guix gc -R "$drv" | grep `guix build guile -nd` > +guix gc -R "$drv" | grep `guix build emacs -nd` At last! This feature is going to be available. These patches LGTM! Brett