Skip to content
Snippets Groups Projects
Commit 0ad7da1e authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

pull: Add '--url' option.

* guix/scripts/pull.scm (%default-options): Add 'tarball-url' pair.
  (%options, show-help): Add '--url'.
  (guix-pull): Honor it.
parent d8907ac4
No related branches found
No related tags found
No related merge requests found
...@@ -137,13 +137,15 @@ (define builder ...@@ -137,13 +137,15 @@ (define builder
(define %default-options (define %default-options
;; Alist of default option values. ;; Alist of default option values.
'()) `((tarball-url . ,%snapshot-url)))
(define (show-help) (define (show-help)
(display (_ "Usage: guix pull [OPTION]... (display (_ "Usage: guix pull [OPTION]...
Download and deploy the latest version of Guix.\n")) Download and deploy the latest version of Guix.\n"))
(display (_ " (display (_ "
--verbose produce verbose output")) --verbose produce verbose output"))
(display (_ "
--url=URL download the Guix tarball from URL"))
(display (_ " (display (_ "
--bootstrap use the bootstrap Guile to build the new Guix")) --bootstrap use the bootstrap Guile to build the new Guix"))
(newline) (newline)
...@@ -159,6 +161,10 @@ (define %options ...@@ -159,6 +161,10 @@ (define %options
(list (option '("verbose") #f #f (list (option '("verbose") #f #f
(lambda (opt name arg result) (lambda (opt name arg result)
(alist-cons 'verbose? #t result))) (alist-cons 'verbose? #t result)))
(option '("url") #t #f
(lambda (opt name arg result)
(alist-cons 'tarball-url arg
(alist-delete 'tarball-url result))))
(option '("bootstrap") #f #f (option '("bootstrap") #f #f
(lambda (opt name arg result) (lambda (opt name arg result)
(alist-cons 'bootstrap? #t result))) (alist-cons 'bootstrap? #t result)))
...@@ -182,10 +188,10 @@ (define (parse-options) ...@@ -182,10 +188,10 @@ (define (parse-options)
%default-options)) %default-options))
(with-error-handling (with-error-handling
(let ((opts (parse-options)) (let* ((opts (parse-options))
(store (open-connection))) (store (open-connection))
(let ((tarball (download-to-store store %snapshot-url (url (assoc-ref opts 'tarball-url)))
"guix-latest.tar.gz"))) (let ((tarball (download-to-store store url "guix-latest.tar.gz")))
(unless tarball (unless tarball
(leave (_ "failed to download up-to-date source, exiting\n"))) (leave (_ "failed to download up-to-date source, exiting\n")))
(parameterize ((%guile-for-build (parameterize ((%guile-for-build
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment