[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/22: packages: 'expand-input' accepts any file-like object.
From: |
guix-commits |
Subject: |
12/22: packages: 'expand-input' accepts any file-like object. |
Date: |
Tue, 30 Mar 2021 17:00:16 -0400 (EDT) |
civodul pushed a commit to branch core-updates
in repository guix.
commit e7477dd59b434080182d12f42905476929e3b4e5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Mar 7 14:40:03 2021 +0100
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.
---
guix/packages.scm | 12 ++----------
tests/packages.scm | 2 +-
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index 3d5c7fd..2b6a1fa 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)
diff --git a/tests/packages.scm b/tests/packages.scm
index f68b078..97c4c17 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -744,7 +744,7 @@
(let ((dummy (dummy-package "foo" (inputs `(("x" ,(current-module)))))))
(test-equal "&package-input-error"
- (list dummy (current-module))
+ (list dummy `("x" ,(current-module)))
(guard (c ((package-input-error? c)
(list (package-error-package c)
(package-error-invalid-input c))))
- 02/22: gexp: Optimize 'with-build-variables'., (continued)
- 02/22: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/30
- 13/22: packages: Call 'bag-grafts' only on the tip of the package graph., guix-commits, 2021/03/30
- 17/22: gnu: docbook-xsl: Move 'use-modules' form to the top level., guix-commits, 2021/03/30
- 15/22: gexp: Allowed/disallowed references and graphs never refer to grafted inputs., guix-commits, 2021/03/30
- 04/22: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/30
- 03/22: build-system: Rewrite using gexps., guix-commits, 2021/03/30
- 05/22: packages: Simplify patch instantiation., guix-commits, 2021/03/30
- 11/22: packages: '%standard-patch-inputs' is not influenced by '%current-target-system'., guix-commits, 2021/03/30
- 10/22: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/30
- 07/22: packages: Default origin 'patch-flags' is a gexp., guix-commits, 2021/03/30
- 12/22: packages: 'expand-input' accepts any file-like object.,
guix-commits <=
- 06/22: packages: Core procedures are written in monadic style., guix-commits, 2021/03/30
- 08/22: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/30
- 18/22: gexp: 'imported+compiled-modules' fully honors #:guile., guix-commits, 2021/03/30
- 21/22: gnu: gnome-shell: Adjust to new #:disallowed-references convention., guix-commits, 2021/03/30
- 19/22: gexp: Add #:guile parameter to 'load-path-expression'., guix-commits, 2021/03/30
- 09/22: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/30
- 14/22: grafts: Add 'without-grafting'., guix-commits, 2021/03/30
- 16/22: gexp: Do not add derivations to the object cache., guix-commits, 2021/03/30
- 22/22: gexp: 'compiled-modules' gets source and parameters an environment variables., guix-commits, 2021/03/30
- 20/22: gexp: 'gexp->script' uses #:guile also as the guile-for-build., guix-commits, 2021/03/30