emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#30409: closed ([PATCH 1/2] guix: Add option --mani


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#30409: closed ([PATCH 1/2] guix: Add option --manifest to guix pack)
Date: Thu, 15 Feb 2018 21:25:01 +0000

Your message dated Thu, 15 Feb 2018 22:24:15 +0100
with message-id <address@hidden>
and subject line Re: [bug#30409] [PATCH 1/2] guix: Add option --manifest to 
guix pack
has caused the debbugs.gnu.org bug report #30409,
regarding [PATCH 1/2] guix: Add option --manifest to guix pack
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
30409: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30409
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH 1/2] guix: Add option --manifest to guix pack Date: Fri, 9 Feb 2018 20:33:12 +0100
* 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)




--- End Message ---
--- Begin Message --- Subject: Re: [bug#30409] [PATCH 1/2] guix: Add option --manifest to guix pack Date: Thu, 15 Feb 2018 22:24:15 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
Konrad Hinsen <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>
>> Awesome!  I took the liberty to make the changes below (let me know if
>> anything’s amiss!), and adjusted the commit log to match our
>> conventions.
>
> Well, there is this:
>
>> @@ -347,6 +348,9 @@ Create a bundle of PACKAGE.\n"))
>>    -C, --compression=TOOL compress using TOOL--e.g., \"lzip\""))
>>    (display (G_ "
>>    -S, --symlink=SPEC     create symlinks to the profile according to SPEC"))
>> +  (display (G_ "
>> +  -m, --manifest=FILE    create a new profile generation with the manifest
>> +                         from FILE"))
>
> The "new profile generation" should probably be "bundle".

Oops, fixed now.  Thanks!

Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]