mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 20:27:36 -05:00
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>
This commit is contained in:
parent
93a5e89008
commit
d7942ac12a
1 changed files with 3 additions and 17 deletions
|
@ -550,32 +550,18 @@ (define (package-field-location package field)
|
|||
#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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue