summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2021-07-19 11:08:40 +0200
committerLudovic Courtès <ludo@gnu.org>2021-07-23 10:51:57 +0200
commitd7942ac12ad51615cd43d3debb8b561a503e8fc0 (patch)
tree25ef7f939eb7dd24d4dca7c8c12af2e1091b5bbc
parent93a5e89008af440655527d03d62d4726683a89ac (diff)
downloadguix-d7942ac12ad51615cd43d3debb8b561a503e8fc0.tar.gz
packages: Use 'lookup-package-input' and friends instead of 'package-input'.
* guix/packages.scm (package-input, package-native-input): Remove.
(this-package-input): Use 'lookup-package-input' and
'lookup-package-propagated-input' instead of 'package-input'.
(this-package-native-input): Use 'lookup-package-native-input'
instead of 'package-input'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/packages.scm20
1 files changed, 3 insertions, 17 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index d3fa72fd09..2349bb4340 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -550,32 +550,18 @@ object."
         #f)))
     (_ #f)))
 
-(define (package-input package name)
-  "Return the package input NAME of PACKAGE--i.e., an input
-from the ‘inputs’ or ‘propagated-inputs’ field.  Native inputs are not
-considered.  If this input does not exist, return #f instead."
-  (and=> (or (assoc-ref (package-inputs package) name)
-             (assoc-ref (package-propagated-inputs package) name))
-         car))
-
-(define (package-native-input package name)
-  "Return the native package input NAME of PACKAGE--i.e., an input
-from the ‘native-inputs’ field. If this native input does not exist,
-return #f instead."
-  (and=> (assoc-ref (package-native-inputs package) name)
-         car))
-
 (define-syntax-rule (this-package-input name)
   "Return the input NAME of the package being defined--i.e., an input
 from the ‘inputs’ or ‘propagated-inputs’ field.  Native inputs are not
 considered.  If this input does not exist, return #f instead."
-  (package-input this-package name))
+  (or (lookup-package-input this-package name)
+      (lookup-package-propagated-input this-package name)))
 
 (define-syntax-rule (this-package-native-input name)
   "Return the native package input NAME of the package being defined--i.e.,
 an input from the ‘native-inputs’ field.  If this native input does not
 exist, return #f instead."
-  (package-native-input this-package name))
+  (lookup-package-native-input this-package name))
 
 ;; Error conditions.