mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
pull: Use `download-to-store'.
* guix/scripts/pull.scm (download-and-store): Remove. (unpack): Use `download-to-store' instead.
This commit is contained in:
parent
1424a96e25
commit
786944576c
1 changed files with 3 additions and 16 deletions
|
@ -22,7 +22,7 @@
|
||||||
#:use-module (guix config)
|
#:use-module (guix config)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix derivations)
|
#:use-module (guix derivations)
|
||||||
#:use-module (guix build download)
|
#:use-module (guix download)
|
||||||
#:use-module (gnu packages base)
|
#:use-module (gnu packages base)
|
||||||
#:use-module ((gnu packages bootstrap)
|
#:use-module ((gnu packages bootstrap)
|
||||||
#:select (%bootstrap-guile))
|
#:select (%bootstrap-guile))
|
||||||
|
@ -38,20 +38,6 @@
|
||||||
"http://git.savannah.gnu.org/cgit/guix.git/snapshot/guix-master.tar.gz"
|
"http://git.savannah.gnu.org/cgit/guix.git/snapshot/guix-master.tar.gz"
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (download-and-store store)
|
|
||||||
"Download the latest Guix tarball, add it to STORE, and return its store
|
|
||||||
path."
|
|
||||||
;; FIXME: Authenticate the downloaded file!
|
|
||||||
;; FIXME: Optimize data transfers using rsync, Git, bsdiff, or GNUnet's DHT.
|
|
||||||
(call-with-temporary-output-file
|
|
||||||
(lambda (temp port)
|
|
||||||
(let ((result
|
|
||||||
(parameterize ((current-output-port (current-error-port)))
|
|
||||||
(url-fetch %snapshot-url temp))))
|
|
||||||
(close port)
|
|
||||||
(and result
|
|
||||||
(add-to-store store "guix-latest.tar.gz" #f "sha256" temp))))))
|
|
||||||
|
|
||||||
(define (unpack store tarball)
|
(define (unpack store tarball)
|
||||||
"Return a derivation that unpacks TARBALL into STORE and compiles Scheme
|
"Return a derivation that unpacks TARBALL into STORE and compiles Scheme
|
||||||
files."
|
files."
|
||||||
|
@ -197,7 +183,8 @@ Download and deploy the latest version of Guix.\n"))
|
||||||
(with-error-handling
|
(with-error-handling
|
||||||
(let ((opts (parse-options))
|
(let ((opts (parse-options))
|
||||||
(store (open-connection)))
|
(store (open-connection)))
|
||||||
(let ((tarball (download-and-store store)))
|
(let ((tarball (download-to-store store %snapshot-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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue