From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: =?utf-8?Q?What=E2=80=99s?= the weather like? Date: Sun, 23 Jul 2017 12:26:16 +0200 Message-ID: <87inij8n5j.fsf@elephly.net> References: <87bmodkem5.fsf@gnu.org> <87mv7v8tzs.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZE5k-0004PO-Vl for guix-devel@gnu.org; Sun, 23 Jul 2017 06:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZE5j-0003jZ-ST for guix-devel@gnu.org; Sun, 23 Jul 2017 06:26:29 -0400 In-reply-to: <87mv7v8tzs.fsf@elephly.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel Ricardo Wurmus 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 +;;; Copyright © 2017 Ricardo Wurmus ;;; ;;; 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