guix-commits
[Top][All Lists]
Advanced

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

01/01: size: Fix corner case with multiple items on the command line.


From: Ludovic Courtès
Subject: 01/01: size: Fix corner case with multiple items on the command line.
Date: Fri, 29 Jul 2016 20:36:47 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit da2d893e324fcdd4ab9e3ccdd62d7aab520da3b5
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jul 29 19:48:23 2016 +0200

    size: Fix corner case with multiple items on the command line.
    
    Fixes 'guix size foo bar' when 'foo' is in the local store and 'bar'
    isn't, which could lead to an incomplete requisite list.
    
    * guix/scripts/size.scm (requisites*): Partition ITEMS according to
    'valid-path?'.  Use 'substitutable-requisites' only on invalid items.
---
 guix/scripts/size.scm |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm
index f28832c..ea259f3 100644
--- a/guix/scripts/size.scm
+++ b/guix/scripts/size.scm
@@ -29,6 +29,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-11)
+  #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-37)
   #:use-module (ice-9 match)
@@ -119,10 +120,12 @@ substitutes."
 information available in the local store or using information about
 substitutes."
   (lambda (store)
-    (guard (c ((nix-protocol-error? c)
-               (values (substitutable-requisites store items)
-                       store)))
-      (values (requisites store items) store))))
+    (let-values (((local missing)
+                  (partition (cut valid-path? store <>) items)))
+      (values (delete-duplicates
+               (append (requisites store local)
+                       (substitutable-requisites store missing)))
+              store))))
 
 (define (store-profile items)
   "Return as a monadic value a list of <profile> objects representing the



reply via email to

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