aboutsummaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-03-07 14:40:03 +0100
committerLudovic Courtès <ludo@gnu.org>2021-03-30 22:48:44 +0200
commite7477dd59b434080182d12f42905476929e3b4e5 (patch)
tree737efb350c86e8c7165113d388e2cf3688139e6b /guix/packages.scm
parent83bdaf3150ba061739c53e82f68a595bf7b9744b (diff)
downloadguix-e7477dd59b434080182d12f42905476929e3b4e5.tar
guix-e7477dd59b434080182d12f42905476929e3b4e5.tar.gz
packages: 'expand-input' accepts any file-like object.
* guix/packages.scm (expand-input)[valid?]: Remove. Call 'file-like?' instead of 'valid?'. Remove 'struct?' clause. * tests/packages.scm ("&package-input-error"): Adjust accordingly.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm12
1 files changed, 2 insertions, 10 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 3d5c7fd64a..2b6a1fabb6 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1213,13 +1213,10 @@ Return the cached result when available."
(define* (expand-input package input #:key native?)
"Expand INPUT, an input tuple, to a name/<gexp-input> tuple. PACKAGE is
only used to provide contextual information in exceptions."
- (define (valid? x)
- (or (package? x) (origin? x) (derivation? x)))
-
(match input
- (((? string? name) (? valid? thing))
+ (((? string? name) (? file-like? thing))
(list name (gexp-input thing #:native? native?)))
- (((? string? name) (? valid? thing) (? string? output))
+ (((? string? name) (? file-like? thing) (? string? output))
(list name (gexp-input thing output #:native? native?)))
(((? string? name)
(and (? string?) (? file-exists? file)))
@@ -1228,11 +1225,6 @@ only used to provide contextual information in exceptions."
;; source.
(list name (gexp-input (local-file file #:recursive? #t)
#:native? native?)))
- (((? string? name) (? struct? source))
- ;; 'package-source-derivation' calls 'lower-object', which can throw
- ;; '&gexp-input-error'. However '&gexp-input-error' lacks source
- ;; location info, so we used to catch and rethrow here (FIXME!).
- (list name (gexp-input source)))
(x
(raise (condition (&package-input-error
(package package)