guix-commits
[Top][All Lists]
Advanced

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

04/04: guix package: --manifest DTRT when combined with --dry-run.


From: Ludovic Courtès
Subject: 04/04: guix package: --manifest DTRT when combined with --dry-run.
Date: Mon, 25 May 2015 19:39:03 +0000

civodul pushed a commit to branch master
in repository guix.

commit 5f1087c48144e15d9e37d23b559017f9d7e326cd
Author: Ludovic Courtès <address@hidden>
Date:   Mon May 25 19:33:19 2015 +0200

    guix package: --manifest DTRT when combined with --dry-run.
    
    * guix/scripts/package.scm (guix-package)[process-actions]: Process 
'manifest
      action regardless of whether 'dry-run? is set.  Adjust the message
      accordingly.
    * tests/guix-package.sh: Add error-reporting test.
---
 guix/scripts/package.scm |   14 ++++++++------
 tests/guix-package.sh    |   18 +++++++++++++++++-
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 06ee441..9da6b9e 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -886,14 +886,16 @@ more information.~%"))
                (alist-delete 'delete-generations opts)))
              (_ #f))
             opts))
-          ((and (assoc-ref opts 'manifest)
-                (not dry-run?))
-           (let* ((file-name (assoc-ref opts 'manifest))
+          ((assoc-ref opts 'manifest)
+           (let* ((file-name   (assoc-ref opts 'manifest))
                   (user-module (make-user-module '((guix profiles)
                                                    (gnu))))
-                  (manifest (load* file-name user-module)))
-             (format #t (_ "installing new manifest from ~a with ~d 
entries.~%")
-                     file-name (length (manifest-entries manifest)))
+                  (manifest    (load* file-name user-module)))
+             (if (assoc-ref opts 'dry-run?)
+                 (format #t (_ "would install new manifest from '~a' with ~d 
entries~%")
+                         file-name (length (manifest-entries manifest)))
+                 (format #t (_ "installing new manifest from '~a' with ~d 
entries~%")
+                         file-name (length (manifest-entries manifest))))
              (build-and-use-profile manifest)))
           (else
            (let* ((manifest    (profile-manifest profile))
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 26a5e9d..b361b1b 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -245,7 +245,7 @@ guix package -I
 
 unset GUIX_BUILD_OPTIONS
 
-# Applying a manifest file
+# Applying a manifest file.
 cat > "$module_dir/manifest.scm"<<EOF
 (use-package-modules bootstrap)
 
@@ -254,3 +254,19 @@ EOF
 guix package --bootstrap -m "$module_dir/manifest.scm"
 guix package -I | grep guile
 test `guix package -I | wc -l` -eq 1
+
+# Error reporting.
+cat > "$module_dir/manifest.scm"<<EOF
+(use-package-modules bootstrap)
+(packages->manifest
+  (list %bootstrap-guile
+        wonderful-package-that-does-not-exist))
+EOF
+if guix package --bootstrap -n -m "$module_dir/manifest.scm" \
+       2> "$module_dir/stderr"
+then false
+else
+    cat "$module_dir/stderr"
+    grep "manifest.scm:[1-3]:.*[Uu]nbound variable.*wonderful-package" \
+        "$module_dir/stderr"
+fi



reply via email to

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