mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 06:06:53 -05:00
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.
This commit is contained in:
parent
1eabf4ec63
commit
d490d06e0f
2 changed files with 23 additions and 3 deletions
|
@ -4184,6 +4184,10 @@ The available options are:
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
|
|
||||||
|
@item --substitute-urls=@var{urls}
|
||||||
|
Use substitute information from @var{urls}.
|
||||||
|
@xref{client-substitute-urls, the same option for @code{guix build}}.
|
||||||
|
|
||||||
@item --map-file=@var{file}
|
@item --map-file=@var{file}
|
||||||
Write to @var{file} a graphical map of disk usage as a PNG file.
|
Write to @var{file} a graphical map of disk usage as a PNG file.
|
||||||
|
|
||||||
|
|
|
@ -231,9 +231,12 @@ (define (show-help)
|
||||||
(display (_ "Usage: guix size [OPTION]... PACKAGE
|
(display (_ "Usage: guix size [OPTION]... PACKAGE
|
||||||
Report the size of PACKAGE and its dependencies.\n"))
|
Report the size of PACKAGE and its dependencies.\n"))
|
||||||
(display (_ "
|
(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 (_ "
|
(display (_ "
|
||||||
-s, --system=SYSTEM consider packages for SYSTEM--e.g., \"i686-linux\""))
|
-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)
|
(newline)
|
||||||
(display (_ "
|
(display (_ "
|
||||||
-h, --help display this help and exit"))
|
-h, --help display this help and exit"))
|
||||||
|
@ -248,6 +251,13 @@ (define %options
|
||||||
(lambda (opt name arg result)
|
(lambda (opt name arg result)
|
||||||
(alist-cons 'system arg
|
(alist-cons 'system arg
|
||||||
(alist-delete 'system result eq?))))
|
(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
|
(option '(#\m "map-file") #t #f
|
||||||
(lambda (opt name arg result)
|
(lambda (opt name arg result)
|
||||||
(alist-cons 'map-file arg result)))
|
(alist-cons 'map-file arg result)))
|
||||||
|
@ -260,7 +270,8 @@ (define %options
|
||||||
(show-version-and-exit "guix size")))))
|
(show-version-and-exit "guix size")))))
|
||||||
|
|
||||||
(define %default-options
|
(define %default-options
|
||||||
`((system . ,(%current-system))))
|
`((system . ,(%current-system))
|
||||||
|
(substitute-urls . ,%default-substitute-urls)))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
@ -275,13 +286,18 @@ (define (guix-size . args)
|
||||||
(_ #f))
|
(_ #f))
|
||||||
opts))
|
opts))
|
||||||
(map-file (assoc-ref opts 'map-file))
|
(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
|
(match files
|
||||||
(()
|
(()
|
||||||
(leave (_ "missing store item argument\n")))
|
(leave (_ "missing store item argument\n")))
|
||||||
((file)
|
((file)
|
||||||
(leave-on-EPIPE
|
(leave-on-EPIPE
|
||||||
(with-store store
|
(with-store store
|
||||||
|
(set-build-options store
|
||||||
|
#:use-substitutes? #t
|
||||||
|
#:substitute-urls urls)
|
||||||
|
|
||||||
(run-with-store store
|
(run-with-store store
|
||||||
(mlet* %store-monad ((item (ensure-store-item file))
|
(mlet* %store-monad ((item (ensure-store-item file))
|
||||||
(profile (store-profile item)))
|
(profile (store-profile item)))
|
||||||
|
|
Loading…
Reference in a new issue