download: Fix 'url-fetch/tarbomb' and 'url-fetch/zipbomb'.
Fixes a regression introduced in 20927c9331
.
Reported by Eric Bavier <ericbavier@centurylink.net>.
* guix/download.scm (url-fetch/tarbomb, url-fetch/zipbomb): Within the gexp,
import (guix build utils) for 'invoke'.
This commit is contained in:
parent
891199c67d
commit
6c293a809b
|
@ -510,12 +510,14 @@ own. This helper makes it easier to deal with \"tar bombs\"."
|
||||||
#:guile guile)))
|
#:guile guile)))
|
||||||
;; Take the tar bomb, and simply unpack it as a directory.
|
;; Take the tar bomb, and simply unpack it as a directory.
|
||||||
(gexp->derivation (or name file-name)
|
(gexp->derivation (or name file-name)
|
||||||
#~(begin
|
(with-imported-modules '((guix build utils))
|
||||||
(mkdir #$output)
|
#~(begin
|
||||||
(setenv "PATH" (string-append #$gzip "/bin"))
|
(use-modules (guix build utils))
|
||||||
(chdir #$output)
|
(mkdir #$output)
|
||||||
(invoke (string-append #$tar "/bin/tar")
|
(setenv "PATH" (string-append #$gzip "/bin"))
|
||||||
"xf" #$drv))
|
(chdir #$output)
|
||||||
|
(invoke (string-append #$tar "/bin/tar")
|
||||||
|
"xf" #$drv)))
|
||||||
#:local-build? #t)))
|
#:local-build? #t)))
|
||||||
|
|
||||||
(define* (url-fetch/zipbomb url hash-algo hash
|
(define* (url-fetch/zipbomb url hash-algo hash
|
||||||
|
@ -540,11 +542,13 @@ own. This helper makes it easier to deal with \"zip bombs\"."
|
||||||
#:guile guile)))
|
#:guile guile)))
|
||||||
;; Take the zip bomb, and simply unpack it as a directory.
|
;; Take the zip bomb, and simply unpack it as a directory.
|
||||||
(gexp->derivation (or name file-name)
|
(gexp->derivation (or name file-name)
|
||||||
#~(begin
|
(with-imported-modules '((guix build utils))
|
||||||
(mkdir #$output)
|
#~(begin
|
||||||
(chdir #$output)
|
(use-modules (guix build utils))
|
||||||
(invoke (string-append #$unzip "/bin/unzip")
|
(mkdir #$output)
|
||||||
#$drv))
|
(chdir #$output)
|
||||||
|
(invoke (string-append #$unzip "/bin/unzip")
|
||||||
|
#$drv)))
|
||||||
#:local-build? #t)))
|
#:local-build? #t)))
|
||||||
|
|
||||||
(define* (download-to-store store url #:optional (name (basename url))
|
(define* (download-to-store store url #:optional (name (basename url))
|
||||||
|
|
Loading…
Reference in New Issue