guix-devel
[Top][All Lists]
Advanced

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

Re: What’s the weather like?


From: Ricardo Wurmus
Subject: Re: What’s the weather like?
Date: Sun, 23 Jul 2017 12:26:16 +0200
User-agent: mu4e 0.9.18; emacs 25.2.1

Ricardo Wurmus <address@hidden> writes:

> Now if one could pass a manifest or a system configuration to “guix
> weather” and it would show how many of the desired packages have
> substitutes that would be even more useful.  Looking at the concise code
> it seems to be an almost trivial change.

Attached is a patch against “weather.scm” that adds a “--manifest”
option.  I used it with my profile’s manifest and got this result:

https://hydra.gnu.org
  98.5% substitutes available (263 out of 267)
  1,063.4 MiB of nars (compressed)
  2,903.9 MiB on disk (uncompressed)
  0.275 seconds per request (73.3 seconds in total)
  3.6 requests per second

Yay!

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net


--- guix/scripts/weather.scm    2017-07-23 12:24:42.094607359 +0200
+++ guix/scripts/weather.scm.more       2017-07-23 12:25:38.284361726 +0200
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2017 Ricardo Wurmus <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
   #:use-module (guix ui)
   #:use-module (guix scripts)
   #:use-module (guix packages)
+  #:use-module (guix profiles)
   #:use-module (guix derivations)
   #:use-module (guix monads)
   #:use-module (guix store)
@@ -168,6 +170,9 @@
                                       (string-tokenize arg)
                                       (alist-delete 'substitute-urls result))
                           rest)))
+         (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 result)))))
@@ -191,7 +196,13 @@
                                         opts)
                        (() (list (%current-system)))
                        (systems systems)))
-           (packages (all-packages))
+           (packages (let ((manifest-file (assoc-ref opts 'manifest)))
+                       (if (and manifest-file (file-exists? manifest-file))
+                           (let* ((user-module  (make-user-module '((guix 
profiles) (gnu))))
+                                  (manifest (load* manifest-file user-module)))
+                             (map manifest-entry-item
+                                  (manifest-transitive-entries manifest)))
+                           (all-packages))))
            (items    (with-store store
                        (parameterize ((%graft? #f))
                          (concatenate





reply via email to

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