mirror of
https://gitlab.com/nonguix/nonguix.git
synced 2025-10-02 02:14:59 +00:00
utils: with-transformation: Handle more cases.
* nonguix/utils.scm (with-transformation): Skip parameters. Avoid duplicating file system packages.
This commit is contained in:
parent
d49157010b
commit
5f3ad33833
1 changed files with 21 additions and 8 deletions
|
@ -64,6 +64,9 @@ matches PRED."
|
||||||
(match obj
|
(match obj
|
||||||
((? pred)
|
((? pred)
|
||||||
(proc obj))
|
(proc obj))
|
||||||
|
;; TODO: Check if this can be handled as well.
|
||||||
|
((? parameter?)
|
||||||
|
obj)
|
||||||
((? procedure?)
|
((? procedure?)
|
||||||
(lambda args
|
(lambda args
|
||||||
(apply values
|
(apply values
|
||||||
|
@ -88,6 +91,16 @@ matches PRED."
|
||||||
(? origin?))
|
(? origin?))
|
||||||
obj)
|
obj)
|
||||||
((? record?)
|
((? record?)
|
||||||
|
(cond
|
||||||
|
;; Both ‘file-systems’ and ‘boot-file-system-utilities’ services extends
|
||||||
|
;; ‘profile-service-type’ with the same package, however information of
|
||||||
|
;; the former one is hidden from us, causing conflict in the resulted
|
||||||
|
;; profile.
|
||||||
|
((and (service? obj)
|
||||||
|
(eq? 'boot-file-system-utilities
|
||||||
|
(service-type-name (service-kind obj))))
|
||||||
|
obj)
|
||||||
|
(else
|
||||||
(let* ((record-type (record-type-descriptor obj))
|
(let* ((record-type (record-type-descriptor obj))
|
||||||
(record-fields (record-type-fields record-type)))
|
(record-fields (record-type-fields record-type)))
|
||||||
(apply (record-constructor record-type)
|
(apply (record-constructor record-type)
|
||||||
|
@ -95,7 +108,7 @@ matches PRED."
|
||||||
(let* ((accessor (record-accessor record-type field))
|
(let* ((accessor (record-accessor record-type field))
|
||||||
(obj (accessor obj)))
|
(obj (accessor obj)))
|
||||||
(with-transformation proc obj pred)))
|
(with-transformation proc obj pred)))
|
||||||
record-fields))))
|
record-fields))))))
|
||||||
(_ obj)))
|
(_ obj)))
|
||||||
|
|
||||||
(define (package-with-alias alias pkg)
|
(define (package-with-alias alias pkg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue