From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekTr4-0007LC-B9 for guix-patches@gnu.org; Sat, 10 Feb 2018 07:02:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekTr1-0007Jx-0Z for guix-patches@gnu.org; Sat, 10 Feb 2018 07:02:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:56495) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekTr0-0007Jf-SZ for guix-patches@gnu.org; Sat, 10 Feb 2018 07:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ekTr0-0006yc-Il for guix-patches@gnu.org; Sat, 10 Feb 2018 07:02:02 -0500 Subject: [bug#30409] [PATCH 1/2] guix: Add option --manifest to guix pack Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekTqB-0006kJ-IJ for guix-patches@gnu.org; Sat, 10 Feb 2018 07:01:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekTq8-0006YS-8k for guix-patches@gnu.org; Sat, 10 Feb 2018 07:01:11 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36379) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ekTq8-0006Xx-3b for guix-patches@gnu.org; Sat, 10 Feb 2018 07:01:08 -0500 From: Konrad Hinsen Date: Fri, 9 Feb 2018 20:33:12 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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: 30409@debbugs.gnu.org * guix/scripts/pack.scm: Extend the way the manifest for the archive contents is created. If the --manifest option is given, read the manifest from the provided file. Otherwise, create the manifest from a package list as before. Check if both a manifest file and a package list were given, which is an error. --- guix/scripts/pack.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index a22258d5a..f772083c6 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -292,6 +292,9 @@ the image." (option '(#\e "expression") #t #f (lambda (opt name arg result) (alist-cons 'expression arg result))) + (option '(#\m "manifest") #t #f + (lambda (opt name arg result) + (alist-cons 'manifest arg result))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg @@ -375,10 +378,21 @@ Create a bundle of PACKAGE.\n")) (read/eval-package-expression exp)) (x #f))) + (define (manifest-from-args opts) + (let ((packages (filter-map maybe-package-argument opts)) + (manifest-file (assoc-ref opts 'manifest))) + (cond + ((and manifest-file (not (null? packages))) + (leave (G_ "both a manifest and a package list were given"))) + (manifest-file + (let ((user-module (make-user-module '((guix profiles) (gnu))))) + (load* manifest-file user-module))) + (else (packages->manifest packages))))) + (with-error-handling (parameterize ((%graft? (assoc-ref opts 'graft?))) (let* ((dry-run? (assoc-ref opts 'dry-run?)) - (packages (filter-map maybe-package-argument opts)) + (manifest (manifest-from-args opts)) (pack-format (assoc-ref opts 'format)) (name (string-append (symbol->string pack-format) "-pack")) @@ -397,7 +411,7 @@ Create a bundle of PACKAGE.\n")) (run-with-store store (mlet* %store-monad ((profile (profile-derivation - (packages->manifest packages) + manifest #:target target)) (drv (build-image name profile #:target -- 2.14.3 (Apple Git-98)