From 9d349afaa1dbcad85511ce6e6a1f2bdd6f43d385 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Mar 2021 09:41:40 +0100 Subject: download: 'url-fetch/tarbomb' and 'url-fetch/zipbomb' refer to native tools. * guix/download.scm (url-fetch/tarbomb, url-fetch/zipbomb): Use 'ungexp-native' instead of 'ungexp' when referring to the decompression tools. --- guix/download.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guix/download.scm') diff --git a/guix/download.scm b/guix/download.scm index 494825860e..579996f090 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2013, 2014, 2015 Andreas Enge ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2016 Alex Griffin @@ -535,9 +535,9 @@ own. This helper makes it easier to deal with \"tar bombs\"." #~(begin (use-modules (guix build utils)) (mkdir #$output) - (setenv "PATH" (string-append #$gzip "/bin")) + (setenv "PATH" (string-append #+gzip "/bin")) (chdir #$output) - (invoke (string-append #$tar "/bin/tar") + (invoke (string-append #+tar "/bin/tar") "xf" #$drv))) #:system system #:guile-for-build guile @@ -574,7 +574,7 @@ own. This helper makes it easier to deal with \"zip bombs\"." (use-modules (guix build utils)) (mkdir #$output) (chdir #$output) - (invoke (string-append #$unzip "/bin/unzip") + (invoke (string-append #+unzip "/bin/unzip") #$drv))) #:system system #:guile-for-build guile -- cgit v1.2.3 From f7008ca71351e5368a7c1c5bc3fe88fb80b01298 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 19 Mar 2021 12:02:08 +0100 Subject: download: Autoload (guix build download). * guix/download.scm: Autoload (guix build download). (url-fetch): Rename to... (url-fetch*): ... this, locally, to allow for #:autoload. * guix/status.scm: Autoload (guix build download). --- guix/download.scm | 49 ++++++++++++++++++++++++------------------------- guix/status.scm | 5 ++--- 2 files changed, 26 insertions(+), 28 deletions(-) (limited to 'guix/download.scm') diff --git a/guix/download.scm b/guix/download.scm index 579996f090..30f69c0325 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -27,7 +27,7 @@ #:use-module (guix derivations) #:use-module (guix packages) #:use-module (guix store) - #:use-module ((guix build download) #:prefix build:) + #:autoload (guix build download) (url-fetch) #:use-module (guix monads) #:use-module (guix gexp) #:use-module (guix utils) @@ -35,7 +35,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%mirrors - url-fetch + (url-fetch* . url-fetch) url-fetch/executable url-fetch/tarbomb url-fetch/zipbomb @@ -449,11 +449,11 @@ download by itself using its own dependencies." ;; for that built-in is widespread. #:local-build? #t))) -(define* (url-fetch url hash-algo hash - #:optional name - #:key (system (%current-system)) - (guile (default-guile)) - executable?) +(define* (url-fetch* url hash-algo hash + #:optional name + #:key (system (%current-system)) + (guile (default-guile)) + executable?) "Return a fixed-output derivation that fetches data from URL (a string, or a list of strings denoting alternate URLs), which is expected to have hash HASH of type HASH-ALGO (a symbol). By default, the file name is the base name of @@ -499,10 +499,10 @@ name in the store." #:key (system (%current-system)) (guile (default-guile))) "Like 'url-fetch', but make the downloaded file executable." - (url-fetch url hash-algo hash name - #:system system - #:guile guile - #:executable? #t)) + (url-fetch* url hash-algo hash name + #:system system + #:guile guile + #:executable? #t)) (define* (url-fetch/tarbomb url hash-algo hash #:optional name @@ -521,11 +521,11 @@ own. This helper makes it easier to deal with \"tar bombs\"." (define tar (module-ref (resolve-interface '(gnu packages base)) 'tar)) - (mlet %store-monad ((drv (url-fetch url hash-algo hash - (string-append "tarbomb-" - (or name file-name)) - #:system system - #:guile guile)) + (mlet %store-monad ((drv (url-fetch* url hash-algo hash + (string-append "tarbomb-" + (or name file-name)) + #:system system + #:guile guile)) (guile (package->derivation guile system))) ;; Take the tar bomb, and simply unpack it as a directory. ;; Use ungrafted tar/gzip so that the resulting tarball doesn't depend on @@ -559,11 +559,11 @@ own. This helper makes it easier to deal with \"zip bombs\"." (define unzip (module-ref (resolve-interface '(gnu packages compression)) 'unzip)) - (mlet %store-monad ((drv (url-fetch url hash-algo hash - (string-append "zipbomb-" - (or name file-name)) - #:system system - #:guile guile)) + (mlet %store-monad ((drv (url-fetch* url hash-algo hash + (string-append "zipbomb-" + (or name file-name)) + #:system system + #:guile guile)) (guile (package->derivation guile system))) ;; Take the zip bomb, and simply unpack it as a directory. ;; Use ungrafted unzip so that the resulting tarball doesn't depend on @@ -598,10 +598,9 @@ whether or not to validate HTTPS server certificates." (lambda (temp port) (let ((result (parameterize ((current-output-port log)) - (build:url-fetch url temp - #:mirrors %mirrors - #:verify-certificate? - verify-certificate?)))) + (url-fetch url temp + #:mirrors %mirrors + #:verify-certificate? verify-certificate?)))) (close port) (and result (add-to-store store name recursive? "sha256" temp))))))) diff --git a/guix/status.scm b/guix/status.scm index 9ca6d92470..d47bf1700c 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. @@ -23,8 +23,7 @@ #:use-module (guix colors) #:use-module (guix progress) #:autoload (guix build syscalls) (terminal-columns) - #:use-module ((guix build download) - #:select (nar-uri-abbreviation)) + #:autoload (guix build download) (nar-uri-abbreviation) #:use-module (guix store) #:use-module (guix derivations) #:use-module (guix memoization) -- cgit v1.2.3