[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/09: size: Add '--substitute-urls' option.
From: |
Ludovic Courtès |
Subject: |
07/09: size: Add '--substitute-urls' option. |
Date: |
Wed, 22 Jul 2015 20:56:57 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit d490d06e0f589828d38553850521d1995d3f0e13
Author: Ludovic Courtès <address@hidden>
Date: Wed Jul 22 19:47:01 2015 +0200
size: Add '--substitute-urls' option.
* guix/scripts/size.scm (show-help, %options): Add --substitute-urls.
(%default-options): Add 'substitute-urls'.
(guix-size): Honor it.
* doc/guix.texi (Invoking guix size): Document it.
---
doc/guix.texi | 4 ++++
guix/scripts/size.scm | 22 +++++++++++++++++++---
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 8c51db8..a512f7d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4184,6 +4184,10 @@ The available options are:
@table @option
address@hidden address@hidden
+Use substitute information from @var{urls}.
address@hidden, the same option for @code{guix build}}.
+
@item address@hidden
Write to @var{file} a graphical map of disk usage as a PNG file.
diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm
index 1aa4d78..92625d8 100644
--- a/guix/scripts/size.scm
+++ b/guix/scripts/size.scm
@@ -231,9 +231,12 @@ the name of a PNG file."
(display (_ "Usage: guix size [OPTION]... PACKAGE
Report the size of PACKAGE and its dependencies.\n"))
(display (_ "
- -m, --map-file=FILE write to FILE a graphical map of disk usage"))
+ --substitute-urls=URLS
+ fetch substitute from URLS if they are authorized"))
(display (_ "
-s, --system=SYSTEM consider packages for SYSTEM--e.g., \"i686-linux\""))
+ (display (_ "
+ -m, --map-file=FILE write to FILE a graphical map of disk usage"))
(newline)
(display (_ "
-h, --help display this help and exit"))
@@ -248,6 +251,13 @@ Report the size of PACKAGE and its dependencies.\n"))
(lambda (opt name arg result)
(alist-cons 'system arg
(alist-delete 'system result eq?))))
+ (option '("substitute-urls") #t #f
+ (lambda (opt name arg result . rest)
+ (apply values
+ (alist-cons 'substitute-urls
+ (string-tokenize arg)
+ (alist-delete 'substitute-urls result))
+ rest)))
(option '(#\m "map-file") #t #f
(lambda (opt name arg result)
(alist-cons 'map-file arg result)))
@@ -260,7 +270,8 @@ Report the size of PACKAGE and its dependencies.\n"))
(show-version-and-exit "guix size")))))
(define %default-options
- `((system . ,(%current-system))))
+ `((system . ,(%current-system))
+ (substitute-urls . ,%default-substitute-urls)))
;;;
@@ -275,13 +286,18 @@ Report the size of PACKAGE and its dependencies.\n"))
(_ #f))
opts))
(map-file (assoc-ref opts 'map-file))
- (system (assoc-ref opts 'system)))
+ (system (assoc-ref opts 'system))
+ (urls (assoc-ref opts 'substitute-urls)))
(match files
(()
(leave (_ "missing store item argument\n")))
((file)
(leave-on-EPIPE
(with-store store
+ (set-build-options store
+ #:use-substitutes? #t
+ #:substitute-urls urls)
+
(run-with-store store
(mlet* %store-monad ((item (ensure-store-item file))
(profile (store-profile item)))
- branch master updated (1436c5c -> 31ea3eb), Ludovic Courtès, 2015/07/22
- 01/09: gnu: guile-minikanren: Fix README location., Ludovic Courtès, 2015/07/22
- 02/09: size: Remove leftover 'pk'., Ludovic Courtès, 2015/07/22
- 03/09: import: hackage: Remove reference to unbound variable., Ludovic Courtès, 2015/07/22
- 04/09: doc: Mention initial passwords in "System Installation"., Ludovic Courtès, 2015/07/22
- 05/09: derivations: Improve complexity of 'substitution-oracle'., Ludovic Courtès, 2015/07/22
- 07/09: size: Add '--substitute-urls' option.,
Ludovic Courtès <=
- 06/09: derivations: Improve docstring of 'substitution-oracle'., Ludovic Courtès, 2015/07/22
- 08/09: doc: Mention zeroed mtimes in the binary tarball., Ludovic Courtès, 2015/07/22
- 09/09: Thank Dave., Ludovic Courtès, 2015/07/22